Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #8291: Onboarding can get stuck if crashed before keyring saved (#…
Browse files Browse the repository at this point in the history
…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 9a39d62 commit 323ed07
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 323ed07

Please sign in to comment.