From 78b056a0b1613ef19d1d72c17fd256c2e86e6774 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 9 Jun 2022 14:16:28 -0300 Subject: remove listener on unload --- packages/taler-wallet-webextension/src/popup/BalancePage.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-webextension/src/popup') diff --git a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx index 6a31fe238..cdf507cb5 100644 --- a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx +++ b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx @@ -44,9 +44,12 @@ export function BalancePage({ const state = useAsyncAsHook(wxApi.getBalance); useEffect(() => { - wxApi.onUpdateNotification([NotificationType.WithdrawGroupFinished], () => { - state?.retry(); - }); + return wxApi.onUpdateNotification( + [NotificationType.WithdrawGroupFinished], + () => { + state?.retry(); + }, + ); }); const balances = !state || state.hasError ? [] : state.response.balances; -- cgit v1.2.3