diff --git a/app/src/main/java/com/keyme/app/ui/KeymeApp.kt b/app/src/main/java/com/keyme/app/ui/KeymeApp.kt index e985677..aefac2f 100644 --- a/app/src/main/java/com/keyme/app/ui/KeymeApp.kt +++ b/app/src/main/java/com/keyme/app/ui/KeymeApp.kt @@ -24,6 +24,7 @@ import com.keyme.presentation.keymetest.keymeTestGraph import com.keyme.presentation.myprofile.ui.KeymeQuestionResultDestination import com.keyme.presentation.myprofile.ui.keymeQuestionResultGraph import com.keyme.presentation.myprofile.ui.myProfileGraph +import com.keyme.presentation.onboarding.OnboardingDestination import com.keyme.presentation.onboarding.onboardingGraph @Composable @@ -33,7 +34,7 @@ fun KeymeApp() { KeymeTheme { Scaffold( bottomBar = { - if (appState.isSignIn) { + if (appState.currentDestination.isOnBoarding().not()) { KeymeBottomBar( currentDestination = appState.currentDestination, onNavigateToDestination = appState::navigate, @@ -78,6 +79,10 @@ fun KeymeApp() { } } +private fun NavDestination?.isOnBoarding(): Boolean { + return this?.hierarchy?.any { it.route == OnboardingDestination.route } == true +} + @Composable fun KeymeBottomBar( currentDestination: NavDestination?, diff --git a/app/src/main/java/com/keyme/app/ui/KeymeAppState.kt b/app/src/main/java/com/keyme/app/ui/KeymeAppState.kt index 6bf6dff..99a76b3 100644 --- a/app/src/main/java/com/keyme/app/ui/KeymeAppState.kt +++ b/app/src/main/java/com/keyme/app/ui/KeymeAppState.kt @@ -44,12 +44,12 @@ class KeymeAppState( val startDestination = OnboardingDestination - var isSignIn by mutableStateOf(false) + var isOnBoarding by mutableStateOf(false) init { coroutineScope.launch { onboardingViewModel.localOnboardingState.collectLatest { - isSignIn = it == OnboardingStepsEnum.MY_DAILY.ordinal + isOnBoarding = it == OnboardingStepsEnum.MY_DAILY.ordinal } } }