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

---
 .../src/components/PendingTransactions.tsx                       | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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

diff --git a/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx b/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx
index 126c82f88..05995395b 100644
--- a/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx
+++ b/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx
@@ -36,9 +36,12 @@ export function PendingTransactions({ goToTransaction }: Props): VNode {
   const state = useAsyncAsHook(wxApi.getTransactions);
 
   useEffect(() => {
-    wxApi.onUpdateNotification([NotificationType.WithdrawGroupFinished], () => {
-      state?.retry();
-    });
+    return wxApi.onUpdateNotification(
+      [NotificationType.WithdrawGroupFinished],
+      () => {
+        state?.retry();
+      },
+    );
   });
 
   const transactions =
-- 
cgit v1.2.3

