From a24e9677e9723b4b2cc45ed724eb1fff11c47fd9 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Mon, 21 Jun 2021 13:53:27 -0400 Subject: [PATCH] Notify browser of wallet activity --- app/scripts/metamask-controller.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index fead800488..eef6968faa 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1727,7 +1727,13 @@ export default class MetamaskController extends EventEmitter { const initState = opts.initState || {} this.keyringController.memStore.subscribe((s) => this._onKeyringControllerUpdate(s)) - this.keyringController.on('unlock', () => this.emit('unlock')) + this.keyringController.on('unlock', () => { + if (chrome.braveWallet && chrome.braveWallet.notifyWalletUnlock) { // eslint-disable-line no-undef + chrome.braveWallet.notifyWalletUnlock() // eslint-disable-line no-undef + } + this.emit('unlock') + }) + this.permissionsController = new PermissionsController({ getKeyringAccounts: this.keyringController.getAccounts.bind(this.keyringController),