remove listener on clicked notification
This commit is contained in:
parent
6fed8e7f8c
commit
3b878f3dba
|
@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue