aboutsummaryrefslogtreecommitdiff
path: root/src/webex/pages/popup.tsx
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-05-04 18:52:54 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-05-08 17:19:07 +0530
commit76e664c9432822c4f5ba717af7f421b7cd015bf3 (patch)
treea3c020adb0f916646b6af2821734064e9abb3186 /src/webex/pages/popup.tsx
parent38601a1c63840bc85eae166f771a974e0629db28 (diff)
downloadwallet-core-76e664c9432822c4f5ba717af7f421b7cd015bf3.tar.xz
update withdrawal page when something changes
Diffstat (limited to 'src/webex/pages/popup.tsx')
-rw-r--r--src/webex/pages/popup.tsx15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/webex/pages/popup.tsx b/src/webex/pages/popup.tsx
index a6c4651df..450aae4ce 100644
--- a/src/webex/pages/popup.tsx
+++ b/src/webex/pages/popup.tsx
@@ -45,17 +45,6 @@ import { PermissionsCheckbox } from "./welcome";
// FIXME: move to newer react functions
/* eslint-disable react/no-deprecated */
-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);
- };
-}
-
class Router extends React.Component<any, any> {
static setRoute(s: string): void {
window.location.hash = s;
@@ -190,7 +179,7 @@ class WalletBalanceView extends React.Component<any, any> {
private unmount = false;
componentWillMount(): void {
- this.canceler = onUpdateNotification(() => this.updateBalance());
+ this.canceler = wxApi.onUpdateNotification(() => this.updateBalance());
this.updateBalance();
}
@@ -651,7 +640,7 @@ class WalletHistory extends React.Component<any, any> {
componentWillMount(): void {
this.update();
this.setState({ filter: true });
- onUpdateNotification(() => this.update());
+ wxApi.onUpdateNotification(() => this.update());
}
componentWillUnmount(): void {