mirror of
https://github.com/bitwarden/android.git
synced 2025-03-15 18:58:59 +03:00
Updating getAuthCodesFlow to update values on emission. (#741)
This commit is contained in:
parent
de99c36b20
commit
eeb4ae75a7
1 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,7 @@ class TotpCodeManagerImpl(
|
|||
private val unconfinedScope = CoroutineScope(dispatcherManager.unconfined)
|
||||
|
||||
private val mutableVerificationCodeStateFlowMap =
|
||||
mutableMapOf<String, StateFlow<DataState<VerificationCodeItem?>>>()
|
||||
mutableMapOf<CipherView, StateFlow<DataState<VerificationCodeItem?>>>()
|
||||
|
||||
override fun getTotpCodesStateFlow(
|
||||
userId: String,
|
||||
|
@ -78,7 +78,7 @@ class TotpCodeManagerImpl(
|
|||
): StateFlow<DataState<VerificationCodeItem?>> {
|
||||
val cipherId = cipher.id ?: return MutableStateFlow(DataState.Loaded(null))
|
||||
|
||||
return mutableVerificationCodeStateFlowMap.getOrPut(cipherId) {
|
||||
return mutableVerificationCodeStateFlowMap.getOrPut(cipher) {
|
||||
flow<DataState<VerificationCodeItem?>> {
|
||||
|
||||
val totpCode = cipher
|
||||
|
@ -134,7 +134,7 @@ class TotpCodeManagerImpl(
|
|||
}
|
||||
}
|
||||
.onCompletion {
|
||||
mutableVerificationCodeStateFlowMap.remove(cipherId)
|
||||
mutableVerificationCodeStateFlowMap.remove(cipher)
|
||||
}
|
||||
.stateIn(
|
||||
scope = unconfinedScope,
|
||||
|
|
Loading…
Add table
Reference in a new issue