-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 accountsChanged notification #1413
Conversation
fa5ae86
to
078d13a
Compare
@@ -864,6 +882,27 @@ export class BrowserTab extends PureComponent { | |||
this.loadUrl(); | |||
} | |||
} | |||
|
|||
const numApprovedHosts = Object.keys(approvedHosts).length; | |||
const prevNumApprovedHosts = Object.keys(prevApprovedHosts).length; |
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.
approvedHosts
and prevApprovedHosts
are always defined?
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.
Yeah, approvedHosts
is set in the privacy reducer. Its initial state is {}
, and the clear action resets it to that.
const networkType = Engine.context.NetworkController.state.provider.type; | ||
const chainId = Object.keys(NetworkList).indexOf(networkType) > -1 && NetworkList[networkType].chainId; | ||
const result = { | ||
isUnlocked, | ||
isEnabled, | ||
selectedAddress: isReady ? selectedAddress.toLowerCase() : null, |
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.
this wasn't necessary?
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.
It was previously, but no longer. The changes I made match what we did on the extension, and we removed isEnabled
and selectedAddress
from the public config store.
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 should have already removed both tbh, but overlooked it.
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.
Fix looks good, QA passed 👍
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.
👌 ship it
* use rpc-engine notifications for accountsChanged * only notify current web page Co-authored-by: Esteban Miño <[email protected]>
json-rpc-engine
notifications to triggeraccountsChanged
events on the inpage providerFixes #1404