aboutsummaryrefslogtreecommitdiff
path: root/src/webex/wxBackend.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-12 16:39:55 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-12 16:39:55 +0100
commitb5a4bcb247ec94ee99ca83c068d660574a36a0d7 (patch)
treeb6fe2b9aebc35f342f730a776ec9a50eb480caa6 /src/webex/wxBackend.ts
parent1bcc5022c27fff2c28c38b3db12ac353cc7d3481 (diff)
downloadwallet-core-b5a4bcb247ec94ee99ca83c068d660574a36a0d7.tar.xz
show notification dot when balance changes (#5214)
Diffstat (limited to 'src/webex/wxBackend.ts')
-rw-r--r--src/webex/wxBackend.ts20
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;