aligning the with develop to use the initial state for reading the activity arguments
This commit is contained in:
parent
15765166fb
commit
70c35304ce
@ -249,7 +249,7 @@ class HomeActivity :
|
|||||||
if (isFirstCreation()) {
|
if (isFirstCreation()) {
|
||||||
handleIntent(intent)
|
handleIntent(intent)
|
||||||
}
|
}
|
||||||
homeActivityViewModel.handle(HomeActivityViewActions.ViewStarted(args?.authenticationDescription))
|
homeActivityViewModel.handle(HomeActivityViewActions.ViewStarted)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun openGroup(shouldClearFragment: Boolean) {
|
private fun openGroup(shouldClearFragment: Boolean) {
|
||||||
|
@ -20,6 +20,6 @@ import im.vector.app.core.platform.VectorViewModelAction
|
|||||||
import im.vector.app.features.onboarding.AuthenticationDescription
|
import im.vector.app.features.onboarding.AuthenticationDescription
|
||||||
|
|
||||||
sealed interface HomeActivityViewActions : VectorViewModelAction {
|
sealed interface HomeActivityViewActions : VectorViewModelAction {
|
||||||
data class ViewStarted(val recentAuthentication: AuthenticationDescription?) : HomeActivityViewActions
|
object ViewStarted : HomeActivityViewActions
|
||||||
object PushPromptHasBeenReviewed : HomeActivityViewActions
|
object PushPromptHasBeenReviewed : HomeActivityViewActions
|
||||||
}
|
}
|
||||||
|
@ -101,18 +101,18 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||||||
private var hasCheckedBootstrap = false
|
private var hasCheckedBootstrap = false
|
||||||
private var onceTrusted = false
|
private var onceTrusted = false
|
||||||
|
|
||||||
private fun initialize(recentAuthentication: AuthenticationDescription?) {
|
private fun initialize() {
|
||||||
if (isInitialized) return
|
if (isInitialized) return
|
||||||
isInitialized = true
|
isInitialized = true
|
||||||
cleanupFiles()
|
cleanupFiles()
|
||||||
observeInitialSync()
|
observeInitialSync()
|
||||||
checkSessionPushIsOn()
|
checkSessionPushIsOn()
|
||||||
observeCrossSigningReset()
|
observeCrossSigningReset()
|
||||||
observeAnalytics(recentAuthentication)
|
observeAnalytics()
|
||||||
initThreadsMigration()
|
initThreadsMigration()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun observeAnalytics(recentAuthentication: AuthenticationDescription?) {
|
private fun observeAnalytics() {
|
||||||
if (analyticsConfig.isEnabled) {
|
if (analyticsConfig.isEnabled) {
|
||||||
analyticsStore.didAskUserConsentFlow
|
analyticsStore.didAskUserConsentFlow
|
||||||
.onEach { didAskUser ->
|
.onEach { didAskUser ->
|
||||||
@ -122,7 +122,7 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
.launchIn(viewModelScope)
|
.launchIn(viewModelScope)
|
||||||
|
|
||||||
recentAuthentication?.let {
|
initialState.authenticationDescription?.let { recentAuthentication ->
|
||||||
when (recentAuthentication) {
|
when (recentAuthentication) {
|
||||||
is AuthenticationDescription.Register -> {
|
is AuthenticationDescription.Register -> {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@ -426,7 +426,7 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||||||
vectorPreferences.setDidAskUserToEnableSessionPush()
|
vectorPreferences.setDidAskUserToEnableSessionPush()
|
||||||
}
|
}
|
||||||
is HomeActivityViewActions.ViewStarted -> {
|
is HomeActivityViewActions.ViewStarted -> {
|
||||||
initialize(action.recentAuthentication)
|
initialize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user