gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 01/02: update every second


From: gnunet
Subject: [taler-wallet-core] 01/02: update every second
Date: Fri, 01 Mar 2024 17:17:21 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

commit 4d36b5a469e03f3485a5ea4448ad3d5bacc1f230
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Mar 1 12:06:02 2024 -0300

    update every second
---
 .../src/components/WalletActivity.tsx                    | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git 
a/packages/taler-wallet-webextension/src/components/WalletActivity.tsx 
b/packages/taler-wallet-webextension/src/components/WalletActivity.tsx
index 1dde08010..48a562098 100644
--- a/packages/taler-wallet-webextension/src/components/WalletActivity.tsx
+++ b/packages/taler-wallet-webextension/src/components/WalletActivity.tsx
@@ -716,12 +716,22 @@ function ErroDetailModal({ error, onClose }: { error: 
TalerErrorDetail, onClose:
 export function ActiveTasksTable({ }: {}): VNode {
   const { i18n } = useTranslationContext()
   const api = useBackendContext();
-  const state = useAsyncAsHook(() =>
-    api.wallet.call(WalletApiOperation.GetActiveTasks, {}),
-  );
+  const state = useAsyncAsHook(() => {
+    return api.wallet.call(WalletApiOperation.GetActiveTasks, {});
+  });
   const [showError, setShowError] = useState<TalerErrorDetail>()
   const tasks = state && !state.hasError ? state.response.tasks : [];
 
+  useEffect(() => {
+    if (!state || state.hasError) return
+    const lastTimeout = setTimeout(() => {
+      state.retry();
+    }, 1000)
+    return () => {
+      clearTimeout(lastTimeout)
+    }
+  }, [tasks])
+
   // const listenAllEvents = Array.from<NotificationType>({ length: 1 });
   // listenAllEvents.includes = () => true
   // useEffect(() => {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]