mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-05 21:43:40 +01:00
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()) {
|
||||
handleIntent(intent)
|
||||
}
|
||||
homeActivityViewModel.handle(HomeActivityViewActions.ViewStarted(args?.authenticationDescription))
|
||||
homeActivityViewModel.handle(HomeActivityViewActions.ViewStarted)
|
||||
}
|
||||
|
||||
private fun openGroup(shouldClearFragment: Boolean) {
|
||||
|
@ -20,6 +20,6 @@ import im.vector.app.core.platform.VectorViewModelAction
|
||||
import im.vector.app.features.onboarding.AuthenticationDescription
|
||||
|
||||
sealed interface HomeActivityViewActions : VectorViewModelAction {
|
||||
data class ViewStarted(val recentAuthentication: AuthenticationDescription?) : HomeActivityViewActions
|
||||
object ViewStarted : HomeActivityViewActions
|
||||
object PushPromptHasBeenReviewed : HomeActivityViewActions
|
||||
}
|
||||
|
@ -101,18 +101,18 @@ class HomeActivityViewModel @AssistedInject constructor(
|
||||
private var hasCheckedBootstrap = false
|
||||
private var onceTrusted = false
|
||||
|
||||
private fun initialize(recentAuthentication: AuthenticationDescription?) {
|
||||
private fun initialize() {
|
||||
if (isInitialized) return
|
||||
isInitialized = true
|
||||
cleanupFiles()
|
||||
observeInitialSync()
|
||||
checkSessionPushIsOn()
|
||||
observeCrossSigningReset()
|
||||
observeAnalytics(recentAuthentication)
|
||||
observeAnalytics()
|
||||
initThreadsMigration()
|
||||
}
|
||||
|
||||
private fun observeAnalytics(recentAuthentication: AuthenticationDescription?) {
|
||||
private fun observeAnalytics() {
|
||||
if (analyticsConfig.isEnabled) {
|
||||
analyticsStore.didAskUserConsentFlow
|
||||
.onEach { didAskUser ->
|
||||
@ -122,7 +122,7 @@ class HomeActivityViewModel @AssistedInject constructor(
|
||||
}
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
recentAuthentication?.let {
|
||||
initialState.authenticationDescription?.let { recentAuthentication ->
|
||||
when (recentAuthentication) {
|
||||
is AuthenticationDescription.Register -> {
|
||||
viewModelScope.launch {
|
||||
@ -426,7 +426,7 @@ class HomeActivityViewModel @AssistedInject constructor(
|
||||
vectorPreferences.setDidAskUserToEnableSessionPush()
|
||||
}
|
||||
is HomeActivityViewActions.ViewStarted -> {
|
||||
initialize(action.recentAuthentication)
|
||||
initialize()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user