mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-27 09:31:20 +01:00
Returning empty viewState instead of null to avoid crash
This commit is contained in:
parent
cb9df953fb
commit
f050fc1e4a
@ -56,7 +56,7 @@ class SoftLogoutViewModel @AssistedInject constructor(
|
||||
|
||||
companion object : MavericksViewModelFactory<SoftLogoutViewModel, SoftLogoutViewState> by hiltMavericksViewModelFactory() {
|
||||
|
||||
override fun initialState(viewModelContext: ViewModelContext): SoftLogoutViewState? {
|
||||
override fun initialState(viewModelContext: ViewModelContext): SoftLogoutViewState {
|
||||
val sessionHolder = EntryPoints.get(viewModelContext.app(), SingletonEntryPoint::class.java)
|
||||
.activeSessionHolder()
|
||||
|
||||
@ -72,7 +72,13 @@ class SoftLogoutViewModel @AssistedInject constructor(
|
||||
hasUnsavedKeys = session.hasUnsavedKeys()
|
||||
)
|
||||
} else {
|
||||
null
|
||||
SoftLogoutViewState(
|
||||
homeServerUrl = "",
|
||||
userId = "",
|
||||
deviceId = "",
|
||||
userDisplayName = "",
|
||||
hasUnsavedKeys = false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user