diff options
author | Sebastian <sebasjm@gmail.com> | 2024-03-01 12:06:02 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-03-01 12:06:02 -0300 |
commit | 4d36b5a469e03f3485a5ea4448ad3d5bacc1f230 (patch) | |
tree | 51b8db42fea8fe69801e95bf4b233966f7c9a978 /packages | |
parent | 1facde4ab16c8d943f16f7cb0ded8dc9104dacfd (diff) | |
download | wallet-core-4d36b5a469e03f3485a5ea4448ad3d5bacc1f230.tar.xz |
update every second
Diffstat (limited to 'packages')
-rw-r--r-- | packages/taler-wallet-webextension/src/components/WalletActivity.tsx | 16 |
1 files 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(() => { |