release notes screen now properly shown on update to a version with app layout labs flag enabled by default (#7175)

This commit is contained in:
Nikita Fedrunov 2022-09-19 22:35:15 +02:00 committed by GitHub
parent 6da6f6a7f4
commit b4f7302057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 11 deletions

View File

@ -119,8 +119,9 @@ class HomeActivityViewModel @AssistedInject constructor(
}
private fun observeReleaseNotes() = withState { state ->
if (vectorPreferences.isNewAppLayoutEnabled()) {
// we don't want to show release notes for new users or after relogin
if (state.authenticationDescription == null && vectorPreferences.isNewAppLayoutEnabled()) {
if (state.authenticationDescription == null) {
releaseNotesPreferencesStore.appLayoutOnboardingShown.onEach { isAppLayoutOnboardingShown ->
if (!isAppLayoutOnboardingShown) {
_viewEvents.post(HomeActivityViewEvents.ShowReleaseNotes)
@ -133,6 +134,7 @@ class HomeActivityViewModel @AssistedInject constructor(
}
}
}
}
private fun observeAnalytics() {
if (analyticsConfig.isEnabled) {

View File

@ -34,7 +34,7 @@ class ReleaseNotesPreferencesStore @Inject constructor(
private val context: Context
) {
private val isAppLayoutOnboardingShown = booleanPreferencesKey("SETTINGS_APP_LAYOUT_ONBOARDING_SHOWN")
private val isAppLayoutOnboardingShown = booleanPreferencesKey("SETTINGS_APP_LAYOUT_ONBOARDING_DISPLAYED")
val appLayoutOnboardingShown: Flow<Boolean> = context.dataStore.data
.map { preferences -> preferences[isAppLayoutOnboardingShown].orFalse() }