-
-
Notifications
You must be signed in to change notification settings - Fork 128
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: eth_accounts / accountsChanged behavior when wallet is locked #405
Changes from all commits
b379314
5894170
4c4aa4b
bb8edc4
692a7ae
e109526
7877537
60bb239
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -409,14 +409,7 @@ export class MetaMaskInpageProvider extends AbstractStreamProvider { | |
* | ||
* @returns Promise resolving to true if MetaMask is currently unlocked. | ||
*/ | ||
isUnlocked: async () => { | ||
if (!this._state.initialized) { | ||
await new Promise<void>((resolve) => { | ||
this.on('_initialized', () => resolve()); | ||
}); | ||
} | ||
return this._state.isUnlocked; | ||
}, | ||
isUnlocked: async () => !this._state.isPermanentlyDisconnected, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Would be nice to have a unit test for this, I don't see one. I know it wasn't covered previously (so it seems), but it looks like it would be easy to add. And coverage is decent for the rest of the file otherwise. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm finding it quite difficult to simulate the unrecoverable disconnection event to actually toggle the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved in 60bb239 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adonesky1 seems not much has to be done since the state |
||
|
||
/** | ||
* Make a batch RPC request. | ||
|
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.
i'm not confident we initialize the value of
isUnlocked
to true without thisThere 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.
Meaning we should still get
isUnlocked
from deconstructing initial stateand set it in this function
Or just default to
true
?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.
Seems it's not necessary to set this after df0acbf