From 78b056a0b1613ef19d1d72c17fd256c2e86e6774 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Thu, 9 Jun 2022 14:16:28 -0300
Subject: remove listener on unload

---
 packages/taler-wallet-webextension/src/wallet/History.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/wallet/History.tsx')

diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx
index 3aa4baeb4..c192b2ba7 100644
--- a/packages/taler-wallet-webextension/src/wallet/History.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/History.tsx
@@ -56,9 +56,12 @@ export function HistoryPage({
   }));
 
   useEffect(() => {
-    wxApi.onUpdateNotification([NotificationType.WithdrawGroupFinished], () => {
-      state?.retry();
-    });
+    return wxApi.onUpdateNotification(
+      [NotificationType.WithdrawGroupFinished],
+      () => {
+        state?.retry();
+      },
+    );
   });
 
   if (!state) {
-- 
cgit v1.2.3

