diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt index 823231f42..3188470f0 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt @@ -38,6 +38,7 @@ class VaultItemViewModel @Inject constructor( private val authRepository: AuthRepository, private val vaultRepository: VaultRepository, ) : BaseViewModel( + // 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,