fixed missing auth description + flag screen as shown after auth flow

This commit is contained in:
NIkita Fedrunov 2022-09-05 16:27:10 +02:00
parent 74fd14af8f
commit f2309af4c6
2 changed files with 7 additions and 1 deletions

View File

@ -117,6 +117,7 @@ class HomeActivityViewModel @AssistedInject constructor(
} }
private fun observeReleaseNotes() = withState { state -> private fun observeReleaseNotes() = withState { state ->
// we don't want to show release notes fore new users or after relogin
if (state.authenticationDescription == null) { if (state.authenticationDescription == null) {
releaseNotesPreferencesStore.appLayoutOnboardingShown.onEach { isAppLayoutOnboardingShown -> releaseNotesPreferencesStore.appLayoutOnboardingShown.onEach { isAppLayoutOnboardingShown ->
if (!isAppLayoutOnboardingShown) { if (!isAppLayoutOnboardingShown) {
@ -124,6 +125,11 @@ class HomeActivityViewModel @AssistedInject constructor(
releaseNotesPreferencesStore.setAppLayoutOnboardingShown(true) releaseNotesPreferencesStore.setAppLayoutOnboardingShown(true)
} }
}.launchIn(viewModelScope) }.launchIn(viewModelScope)
} else {
//we assume that users which came from auth flow either have seen updates already (relogin) or don't need them (new user)
viewModelScope.launch {
releaseNotesPreferencesStore.setAppLayoutOnboardingShown(true)
}
} }
} }

View File

@ -627,7 +627,7 @@ class OnboardingViewModel @AssistedInject constructor(
_viewEvents.post(OnboardingViewEvents.OnAccountCreated) _viewEvents.post(OnboardingViewEvents.OnAccountCreated)
} }
AuthenticationDescription.Login -> { AuthenticationDescription.Login -> {
setState { copy(isLoading = false) } setState { copy(isLoading = false, selectedAuthenticationState = SelectedAuthenticationState(authenticationDescription)) }
_viewEvents.post(OnboardingViewEvents.OnAccountSignedIn) _viewEvents.post(OnboardingViewEvents.OnAccountSignedIn)
} }
} }