persisting the use case at the point of session creation
- this ensures we have a unique session or account id to store the selection against in case we support multi account in the future
This commit is contained in:
parent
0a7c421faa
commit
c4ac03949c
@ -464,22 +464,14 @@ class OnboardingViewModel @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun handleUpdateUseCase(action: OnboardingAction.UpdateUseCase) {
|
private fun handleUpdateUseCase(action: OnboardingAction.UpdateUseCase) {
|
||||||
viewModelScope.launch {
|
setState { copy(useCase = action.useCase) }
|
||||||
onboardingStore.setUseCase(action.useCase)
|
analyticsTracker.updateUserProperties(Identity(ftueUseCaseSelection = action.useCase.toTrackingValue()))
|
||||||
analyticsTracker.updateUserProperties(
|
|
||||||
Identity(ftueUseCaseSelection = action.useCase.toTrackingValue())
|
|
||||||
)
|
|
||||||
}
|
|
||||||
_viewEvents.post(OnboardingViewEvents.OpenServerSelection)
|
_viewEvents.post(OnboardingViewEvents.OpenServerSelection)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun resetUseCase() {
|
private fun resetUseCase() {
|
||||||
viewModelScope.launch {
|
setState { copy(useCase = null) }
|
||||||
onboardingStore.resetUseCase()
|
analyticsTracker.updateUserProperties(Identity(ftueUseCaseSelection = null))
|
||||||
analyticsTracker.updateUserProperties(
|
|
||||||
Identity(ftueUseCaseSelection = null)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleUpdateServerType(action: OnboardingAction.UpdateServerType) {
|
private fun handleUpdateServerType(action: OnboardingAction.UpdateServerType) {
|
||||||
@ -760,6 +752,9 @@ class OnboardingViewModel @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun onSessionCreated(session: Session) {
|
private suspend fun onSessionCreated(session: Session) {
|
||||||
|
awaitState().useCase?.let { useCase ->
|
||||||
|
onboardingStore.setUseCase(useCase)
|
||||||
|
}
|
||||||
activeSessionHolder.setActiveSession(session)
|
activeSessionHolder.setActiveSession(session)
|
||||||
|
|
||||||
authenticationService.reset()
|
authenticationService.reset()
|
||||||
|
@ -40,6 +40,8 @@ data class OnboardingViewState(
|
|||||||
@PersistState
|
@PersistState
|
||||||
val serverType: ServerType = ServerType.Unknown,
|
val serverType: ServerType = ServerType.Unknown,
|
||||||
@PersistState
|
@PersistState
|
||||||
|
val useCase: FtueUseCase? = null,
|
||||||
|
@PersistState
|
||||||
val signMode: SignMode = SignMode.Unknown,
|
val signMode: SignMode = SignMode.Unknown,
|
||||||
@PersistState
|
@PersistState
|
||||||
val resetPasswordEmail: String? = null,
|
val resetPasswordEmail: String? = null,
|
||||||
|
Loading…
Reference in New Issue
Block a user