remove listener on clicked notification
This commit is contained in:
parent
6fed8e7f8c
commit
3b878f3dba
|
@ -109,15 +109,16 @@ class ExtensionPlatform {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
_subscribeToNotificationClicked () {
|
_subscribeToNotificationClicked = () => {
|
||||||
if (!extension.notifications.onClicked.hasListener(this._viewOnEtherScan)) {
|
if (!extension.notifications.onClicked.hasListener(this._viewOnExplorer)) {
|
||||||
extension.notifications.onClicked.addListener(this._viewOnEtherScan)
|
extension.notifications.onClicked.addListener((url) => this._viewOnExplorer(url))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_viewOnEtherScan (txId) {
|
_viewOnExplorer (url) {
|
||||||
if (txId.startsWith('http://') || txId.startsWith('https://')) {
|
if (url.startsWith('http://') || url.startsWith('https://')) {
|
||||||
global.metamaskController.platform.openWindow({ url: txId })
|
extension.notifications.onClicked.removeListener(this._viewOnExplorer)
|
||||||
|
global.metamaskController.platform.openWindow({ url })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue