mirror of
https://github.com/bitwarden/android.git
synced 2024-11-22 09:25:58 +03:00
Stop persisting view-item state to SavedStateHandle (#377)
This commit is contained in:
parent
cc48e63e89
commit
4e686fcc2e
1 changed files with 1 additions and 2 deletions
|
@ -38,6 +38,7 @@ class VaultItemViewModel @Inject constructor(
|
|||
private val authRepository: AuthRepository,
|
||||
private val vaultRepository: VaultRepository,
|
||||
) : BaseViewModel<VaultItemState, VaultItemEvent, VaultItemAction>(
|
||||
// We load the state from the savedStateHandle for testing purposes.
|
||||
initialState = savedStateHandle[KEY_STATE] ?: VaultItemState(
|
||||
vaultItemId = VaultItemArgs(savedStateHandle).vaultItemId,
|
||||
viewState = VaultItemState.ViewState.Loading,
|
||||
|
@ -46,8 +47,6 @@ class VaultItemViewModel @Inject constructor(
|
|||
) {
|
||||
|
||||
init {
|
||||
stateFlow.onEach { savedStateHandle[KEY_STATE] = it }.launchIn(viewModelScope)
|
||||
|
||||
combine(
|
||||
vaultRepository.getVaultItemStateFlow(state.vaultItemId),
|
||||
authRepository.userStateFlow,
|
||||
|
|
Loading…
Reference in a new issue