mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 04:52:00 +03:00
Better to call setAppLayoutOnboardingShown when we are sure the Activity has been run.
This commit is contained in:
parent
b3eac52e3f
commit
16fad63e49
2 changed files with 10 additions and 1 deletions
|
@ -123,7 +123,6 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||
if (state.authenticationDescription == null && vectorFeatures.isNewAppLayoutEnabled()) {
|
||||
releaseNotesPreferencesStore.appLayoutOnboardingShown.onEach { isAppLayoutOnboardingShown ->
|
||||
if (!isAppLayoutOnboardingShown) {
|
||||
releaseNotesPreferencesStore.setAppLayoutOnboardingShown(true)
|
||||
_viewEvents.post(HomeActivityViewEvents.ShowReleaseNotes)
|
||||
}
|
||||
}.launchIn(viewModelScope)
|
||||
|
|
|
@ -16,17 +16,20 @@
|
|||
|
||||
package im.vector.app.features.home.room.list.home.release
|
||||
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.platform.ScreenOrientationLocker
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivitySimpleBinding
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class ReleaseNotesActivity : VectorBaseActivity<ActivitySimpleBinding>() {
|
||||
|
||||
@Inject lateinit var orientationLocker: ScreenOrientationLocker
|
||||
@Inject lateinit var releaseNotesPreferencesStore: ReleaseNotesPreferencesStore
|
||||
|
||||
override fun getBinding() = ActivitySimpleBinding.inflate(layoutInflater)
|
||||
|
||||
|
@ -38,4 +41,11 @@ class ReleaseNotesActivity : VectorBaseActivity<ActivitySimpleBinding>() {
|
|||
addFragment(views.simpleFragmentContainer, ReleaseNotesFragment::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
lifecycleScope.launch {
|
||||
releaseNotesPreferencesStore.setAppLayoutOnboardingShown(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue