diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-12-12 16:39:55 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-12-12 16:39:55 +0100 |
commit | b5a4bcb247ec94ee99ca83c068d660574a36a0d7 (patch) | |
tree | b6fe2b9aebc35f342f730a776ec9a50eb480caa6 /src/webex/wxBackend.ts | |
parent | 1bcc5022c27fff2c28c38b3db12ac353cc7d3481 (diff) | |
download | wallet-core-b5a4bcb247ec94ee99ca83c068d660574a36a0d7.tar.xz |
show notification dot when balance changes (#5214)
Diffstat (limited to 'src/webex/wxBackend.ts')
-rw-r--r-- | src/webex/wxBackend.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/webex/wxBackend.ts b/src/webex/wxBackend.ts index a7757c68e..a804c73d1 100644 --- a/src/webex/wxBackend.ts +++ b/src/webex/wxBackend.ts @@ -337,6 +337,9 @@ function handleMessage(sender: MessageSender, const req = GetTipPlanchetsRequest.checked(detail); return needsWallet().getTipPlanchets(req.merchantDomain, req.tipId, req.amount, req.deadline, req.exchangeUrl, req.nextUrl); } + case "clear-notification": { + return needsWallet().clearNotification(); + } default: // Exhaustiveness check. // See https://www.typescriptlang.org/docs/handbook/advanced-types.html @@ -698,6 +701,23 @@ export async function wxMain() { }); + + // Clear notifications both when the popop opens, + // as well when it closes. + chrome.runtime.onConnect.addListener((port) => { + if (port.name == "popup") { + if (currentWallet) { + currentWallet.clearNotification(); + } + port.onDisconnect.addListener(() => { + if (currentWallet) { + currentWallet.clearNotification(); + } + }); + } + }); + + // Handlers for catching HTTP requests chrome.webRequest.onHeadersReceived.addListener((details) => { const wallet = currentWallet; |