PM-10528: Fix user switching issue due to rapid Activity recreation when locking (#3669)

This commit is contained in:
Brian Yencho 2024-08-02 16:39:23 -05:00 committed by GitHub
parent 32b260ca9f
commit aae7a6e895
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,6 +112,10 @@ class MainViewModel @Inject constructor(
.onEach {
when (it) {
is VaultStateEvent.Locked -> {
// Similar to account switching, triggering this action too soon can
// interfere with animations or navigation logic, so we will delay slightly.
@Suppress("MagicNumber")
delay(500)
trySendAction(MainAction.Internal.VaultUnlockStateChange)
}