mirror of
https://github.com/bitwarden/android.git
synced 2026-03-16 08:33:59 -05:00
Stop persisting view-item state to SavedStateHandle (#377)
This commit is contained in:
committed by
Álison Fernandes
parent
cc48e63e89
commit
4e686fcc2e
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user