Skip to content

Commit

Permalink
Show user profile only if no user profile has been created yet.
Browse files Browse the repository at this point in the history
To get the create user profile page shown, one need to delete the data directory in simulator, or the rest api data directory if client mode is used. with that the created user identity is deleted.
  • Loading branch information
HenrikJannsen committed Nov 22, 2024
1 parent bf07139 commit bc9a35f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ val presentationModule = module {

single {
SplashPresenter(
get(),
get(),
get()
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package network.bisq.mobile.presentation.ui.uicases.startup

import androidx.navigation.NavController
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import network.bisq.mobile.domain.data.repository.main.bootstrap.ApplicationBootstrapFacade
import network.bisq.mobile.domain.user_profile.UserProfileServiceFacade
import network.bisq.mobile.presentation.BasePresenter
import network.bisq.mobile.presentation.MainPresenter
import network.bisq.mobile.presentation.ui.navigation.Routes

open class SplashPresenter(
mainPresenter: MainPresenter,
applicationBootstrapFacade: ApplicationBootstrapFacade
applicationBootstrapFacade: ApplicationBootstrapFacade,
private val userProfileService: UserProfileServiceFacade
) : BasePresenter(mainPresenter) {
private val coroutineScope = CoroutineScope(Dispatchers.Main)

Expand All @@ -29,21 +30,15 @@ open class SplashPresenter(
}
}

private fun navigateToNextScreen() {
// TODO: Conditional nav
// If firstTimeApp launch, goto Onboarding[clientMode] (androidNode / xClient)
// If not, goto TabContainerScreen
/* rootNavigator.navigate(Routes.Onboarding.name) {
popUpTo(Routes.Splash.name) { inclusive = true }
}*/

//TODO
/* rootNavigator.navigate(Routes.TabContainer.name) {
popUpTo(Routes.TrustedNodeSetup.name) { inclusive = true }
}*/
rootNavigator.navigate(Routes.CreateProfile.name) {
popUpTo(Routes.Splash.name) { inclusive = true }
private suspend fun navigateToNextScreen() {
if(userProfileService.hasUserProfile()){
rootNavigator.navigate(Routes.TabContainer.name) {
popUpTo(Routes.Splash.name) { inclusive = true }
}
}else{
rootNavigator.navigate(Routes.CreateProfile.name) {
popUpTo(Routes.Splash.name) { inclusive = true }
}
}
}

}

0 comments on commit bc9a35f

Please sign in to comment.