BIT-2318: Clear input when VaultUnlockViewModel is cleared (#1355)

This commit is contained in:
David Perez 2024-05-10 11:59:54 -05:00 committed by Álison Fernandes
parent 903aa26876
commit 2d80a215c5

View file

@ -109,6 +109,13 @@ class VaultUnlockViewModel @Inject constructor(
}
}
override fun onCleared() {
// TODO: This is required because there is an OS-level leak occurring that leaves the
// ViewModel in memory. We should remove this when that leak is fixed. (BIT-2287)
mutableStateFlow.update { it.copy(input = "") }
super.onCleared()
}
override fun handleAction(action: VaultUnlockAction) {
when (action) {
VaultUnlockAction.AddAccountClick -> handleAddAccountClick()