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:
parent
6da6f6a7f4
commit
b4f7302057
|
@ -119,17 +119,19 @@ class HomeActivityViewModel @AssistedInject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun observeReleaseNotes() = withState { state ->
|
private fun observeReleaseNotes() = withState { state ->
|
||||||
// we don't want to show release notes for new users or after relogin
|
if (vectorPreferences.isNewAppLayoutEnabled()) {
|
||||||
if (state.authenticationDescription == null && vectorPreferences.isNewAppLayoutEnabled()) {
|
// we don't want to show release notes for new users or after relogin
|
||||||
releaseNotesPreferencesStore.appLayoutOnboardingShown.onEach { isAppLayoutOnboardingShown ->
|
if (state.authenticationDescription == null) {
|
||||||
if (!isAppLayoutOnboardingShown) {
|
releaseNotesPreferencesStore.appLayoutOnboardingShown.onEach { isAppLayoutOnboardingShown ->
|
||||||
_viewEvents.post(HomeActivityViewEvents.ShowReleaseNotes)
|
if (!isAppLayoutOnboardingShown) {
|
||||||
|
_viewEvents.post(HomeActivityViewEvents.ShowReleaseNotes)
|
||||||
|
}
|
||||||
|
}.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)
|
||||||
}
|
}
|
||||||
}.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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class ReleaseNotesPreferencesStore @Inject constructor(
|
||||||
private val context: Context
|
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
|
val appLayoutOnboardingShown: Flow<Boolean> = context.dataStore.data
|
||||||
.map { preferences -> preferences[isAppLayoutOnboardingShown].orFalse() }
|
.map { preferences -> preferences[isAppLayoutOnboardingShown].orFalse() }
|
||||||
|
|
Loading…
Reference in New Issue