Skip to content

Commit

Permalink
Fix brave/brave-ios#8291: Onboarding can get stuck if crashed before …
Browse files Browse the repository at this point in the history
…keyring saved (brave/brave-ios#8293)

Add fallback for case where user completes onboarding, but keyring is not saved. Bug could lock user into onboarding without any way to dismiss Wallet or proceed.
  • Loading branch information
StephenHeaps authored Oct 19, 2023
1 parent b886bcc commit cf9de8f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/BraveWallet/Crypto/Stores/KeyringStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ public class KeyringStore: ObservableObject, WalletObserverStore {
self.defaultKeyring = defaultKeyring
self.isDefaultKeyringLoaded = true
self.isDefaultKeyringCreated = defaultKeyring.isKeyringCreated
// fallback case where user completed front-end onboarding, but has no keyring created/accounts.
if !defaultKeyring.isKeyringCreated && Preferences.Wallet.isOnboardingCompleted.value {
Preferences.Wallet.isOnboardingCompleted.reset()
}
}
self.allKeyrings = allKeyrings
if let selectedAccountKeyring = allKeyrings.first(where: { $0.id == selectedAccount?.keyringId }) {
Expand Down

0 comments on commit cf9de8f

Please sign in to comment.