-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: stop beignet wallet before replace/wipe it #2385
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected] |
// stop onchain wallet if it exists | ||
try { | ||
const wallet = getOnChainWallet(); | ||
await wallet.stop(); | ||
} catch (e) {} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can expect the wallet to exist at this point, so it should be able to be stopped. If it does fail we should probably propagate and return the error. Especially if we're going to remove the restart in the future.
// stop onchain wallet if it exists | |
try { | |
const wallet = getOnChainWallet(); | |
await wallet.stop(); | |
} catch (e) {} | |
// stop onchain wallet if it exists | |
const wallet = getOnChainWallet(); | |
await wallet.stop(); | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We run wipeApp during Onboard/TermsOfUse, at this point wallet does not exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right ok let's leave it for now. If we're going to remove the restart later we should probably return the error outside the onboarding though.
Description
This should prevent wallet instance to write any data to the redux or call any onMessage callback after it has been stoped.
Maybe we can stop restarting RN after this
Linked Issues/Tasks
Type of change
Bug fix
Tests
No test