From 76e664c9432822c4f5ba717af7f421b7cd015bf3 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 4 May 2020 18:52:54 +0530 Subject: update withdrawal page when something changes --- src/webex/wxApi.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/webex/wxApi.ts') diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts index 128041e57..0bd444856 100644 --- a/src/webex/wxApi.ts +++ b/src/webex/wxApi.ts @@ -339,3 +339,15 @@ export function setExtendedPermissions(value: boolean): Promise { return callBackend("get-extended-permissions", {}); } + + +export function onUpdateNotification(f: () => void): () => void { + const port = chrome.runtime.connect({ name: "notifications" }); + const listener = (): void => { + f(); + }; + port.onMessage.addListener(listener); + return () => { + port.onMessage.removeListener(listener); + }; +} \ No newline at end of file -- cgit v1.2.3