auth to server-V96

This commit is contained in:
Eric85710 2026-05-14 13:47:37 +08:00
parent d9f5efc680
commit 54ba82ebeb
2 changed files with 14 additions and 4 deletions

View file

@ -63,7 +63,8 @@ import kotlin.text.ifEmpty
@Composable
fun AddAccountScreen(
paddingValues: PaddingValues,
viewModel: AuthViewModel = hiltViewModel()
viewModel: AuthViewModel = hiltViewModel(),
onBack: () -> Unit,
){
val uiState by viewModel.loginState.collectAsStateWithLifecycle()

View file

@ -46,9 +46,15 @@ fun AppNavGraph(
paddingValues = paddingValues
)
AppScreen.AddAccount -> AddAccountScreen(
paddingValues = paddingValues
)
AppScreen.AddAccount -> {
BackHandler {
appViewModel.goTo(AppScreen.ScreensTab)
}
AddAccountScreen(
paddingValues = paddingValues,
onBack = { appViewModel.goTo(AppScreen.ScreensTab) }
)
}
AppScreen.Register -> {
//back to pre_reg
@ -72,6 +78,9 @@ fun AppNavGraph(
AppScreen.ScreensTab -> MainScreen_tab()
AppScreen.AccountSwitch -> {
BackHandler {
appViewModel.goTo(AppScreen.ScreensTab)
}
AccountSwitchScreen(
// 點擊「登入另一個帳號」就跳轉到 Login 頁面
onAddAccountClick = { appViewModel.goTo(AppScreen.AddAccount) },