Skip to content

Commit

Permalink
Fix for when move to idle state is called twice (#2152)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpanshu committed Dec 2, 2022
1 parent cb557ab commit c15e059
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -64,7 +64,10 @@ internal sealed class CredentialStoreState : State {
val action = credentialStoreActions.loadCredentialStoreAction(storeEvent.credentialType)
StateResolution(LoadingStoredCredentials(), listOf(action))
}
is CredentialStoreEvent.EventType.ThrowError -> StateResolution(Error(storeEvent.error))
is CredentialStoreEvent.EventType.ThrowError -> {
val action = credentialStoreActions.moveToIdleStateAction()
StateResolution(Error(storeEvent.error), listOf(action))
}
else -> defaultResolution
}
is LoadingStoredCredentials, is StoringCredentials, is ClearingCredentials -> when (storeEvent) {
Expand Down Expand Up @@ -96,8 +99,7 @@ internal sealed class CredentialStoreState : State {
}
is Success, is Error -> when (storeEvent) {
is CredentialStoreEvent.EventType.MoveToIdleState -> {
val action = credentialStoreActions.moveToIdleStateAction()
StateResolution(Idle(), listOf(action))
StateResolution(Idle(), listOf())
}
else -> StateResolution(oldState)
}
Expand Down

0 comments on commit c15e059

Please sign in to comment.