From f2309af4c61d28bf20719b375db57e3295dd79e6 Mon Sep 17 00:00:00 2001 From: NIkita Fedrunov Date: Mon, 5 Sep 2022 16:27:10 +0200 Subject: [PATCH] fixed missing auth description + flag screen as shown after auth flow --- .../im/vector/app/features/home/HomeActivityViewModel.kt | 6 ++++++ .../vector/app/features/onboarding/OnboardingViewModel.kt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt index ccd7e45bba..949e877fac 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt @@ -117,6 +117,7 @@ class HomeActivityViewModel @AssistedInject constructor( } private fun observeReleaseNotes() = withState { state -> + // we don't want to show release notes fore new users or after relogin if (state.authenticationDescription == null) { releaseNotesPreferencesStore.appLayoutOnboardingShown.onEach { isAppLayoutOnboardingShown -> if (!isAppLayoutOnboardingShown) { @@ -124,6 +125,11 @@ class HomeActivityViewModel @AssistedInject constructor( releaseNotesPreferencesStore.setAppLayoutOnboardingShown(true) } }.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) + } } } diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt index 9661feb002..52c445f1fa 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt @@ -627,7 +627,7 @@ class OnboardingViewModel @AssistedInject constructor( _viewEvents.post(OnboardingViewEvents.OnAccountCreated) } AuthenticationDescription.Login -> { - setState { copy(isLoading = false) } + setState { copy(isLoading = false, selectedAuthenticationState = SelectedAuthenticationState(authenticationDescription)) } _viewEvents.post(OnboardingViewEvents.OnAccountSignedIn) } }