From 3b878f3dba3585dfd01c82f9ebf9948a91f4e3f8 Mon Sep 17 00:00:00 2001 From: vbaranov Date: Mon, 29 Oct 2018 17:12:08 +0300 Subject: [PATCH] remove listener on clicked notification --- app/scripts/platforms/extension.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 3bbdfa4bc..03543829a 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -109,15 +109,16 @@ class ExtensionPlatform { }) } - _subscribeToNotificationClicked () { - if (!extension.notifications.onClicked.hasListener(this._viewOnEtherScan)) { - extension.notifications.onClicked.addListener(this._viewOnEtherScan) + _subscribeToNotificationClicked = () => { + if (!extension.notifications.onClicked.hasListener(this._viewOnExplorer)) { + extension.notifications.onClicked.addListener((url) => this._viewOnExplorer(url)) } } - _viewOnEtherScan (txId) { - if (txId.startsWith('http://') || txId.startsWith('https://')) { - global.metamaskController.platform.openWindow({ url: txId }) + _viewOnExplorer (url) { + if (url.startsWith('http://') || url.startsWith('https://')) { + extension.notifications.onClicked.removeListener(this._viewOnExplorer) + global.metamaskController.platform.openWindow({ url }) } }