don't show release notes if app layout isn't enabled
This commit is contained in:
parent
108e1b874c
commit
fc265dd480
|
@ -26,6 +26,7 @@ import im.vector.app.core.di.ActiveSessionHolder
|
||||||
import im.vector.app.core.di.MavericksAssistedViewModelFactory
|
import im.vector.app.core.di.MavericksAssistedViewModelFactory
|
||||||
import im.vector.app.core.di.hiltMavericksViewModelFactory
|
import im.vector.app.core.di.hiltMavericksViewModelFactory
|
||||||
import im.vector.app.core.platform.VectorViewModel
|
import im.vector.app.core.platform.VectorViewModel
|
||||||
|
import im.vector.app.features.VectorFeatures
|
||||||
import im.vector.app.features.analytics.AnalyticsConfig
|
import im.vector.app.features.analytics.AnalyticsConfig
|
||||||
import im.vector.app.features.analytics.AnalyticsTracker
|
import im.vector.app.features.analytics.AnalyticsTracker
|
||||||
import im.vector.app.features.analytics.extensions.toAnalyticsType
|
import im.vector.app.features.analytics.extensions.toAnalyticsType
|
||||||
|
@ -84,6 +85,7 @@ class HomeActivityViewModel @AssistedInject constructor(
|
||||||
private val analyticsTracker: AnalyticsTracker,
|
private val analyticsTracker: AnalyticsTracker,
|
||||||
private val analyticsConfig: AnalyticsConfig,
|
private val analyticsConfig: AnalyticsConfig,
|
||||||
private val releaseNotesPreferencesStore: ReleaseNotesPreferencesStore,
|
private val releaseNotesPreferencesStore: ReleaseNotesPreferencesStore,
|
||||||
|
private val vectorFeatures: VectorFeatures,
|
||||||
) : VectorViewModel<HomeActivityViewState, HomeActivityViewActions, HomeActivityViewEvents>(initialState) {
|
) : VectorViewModel<HomeActivityViewState, HomeActivityViewActions, HomeActivityViewEvents>(initialState) {
|
||||||
|
|
||||||
@AssistedFactory
|
@AssistedFactory
|
||||||
|
@ -118,7 +120,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
|
// we don't want to show release notes fore new users or after relogin
|
||||||
if (state.authenticationDescription == null) {
|
if (state.authenticationDescription == null && vectorFeatures.isNewAppLayoutEnabled()) {
|
||||||
releaseNotesPreferencesStore.appLayoutOnboardingShown.onEach { isAppLayoutOnboardingShown ->
|
releaseNotesPreferencesStore.appLayoutOnboardingShown.onEach { isAppLayoutOnboardingShown ->
|
||||||
if (!isAppLayoutOnboardingShown) {
|
if (!isAppLayoutOnboardingShown) {
|
||||||
_viewEvents.post(HomeActivityViewEvents.ShowReleaseNotes)
|
_viewEvents.post(HomeActivityViewEvents.ShowReleaseNotes)
|
||||||
|
@ -126,7 +128,7 @@ class HomeActivityViewModel @AssistedInject constructor(
|
||||||
}
|
}
|
||||||
}.launchIn(viewModelScope)
|
}.launchIn(viewModelScope)
|
||||||
} else {
|
} else {
|
||||||
//we assume that users which came from auth flow either have seen updates already (relogin) or don't need them (new user)
|
// we assume that users which came from auth flow either have seen updates already (relogin) or don't need them (new user)
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
releaseNotesPreferencesStore.setAppLayoutOnboardingShown(true)
|
releaseNotesPreferencesStore.setAppLayoutOnboardingShown(true)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue