From 0015e14571d272933d220b10d087c754f2071088 Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:56:01 +0100 Subject: [PATCH 1/2] Fix(Indexing status): poll every minute --- .../src/components/sidebar/IndexingStatus/index.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/sidebar/IndexingStatus/index.tsx b/apps/web/src/components/sidebar/IndexingStatus/index.tsx index c7e81db635..5d65d71a2f 100644 --- a/apps/web/src/components/sidebar/IndexingStatus/index.tsx +++ b/apps/web/src/components/sidebar/IndexingStatus/index.tsx @@ -4,16 +4,23 @@ import { getIndexingStatus } from '@safe-global/safe-gateway-typescript-sdk' import useAsync from '@/hooks/useAsync' import useChainId from '@/hooks/useChainId' import ExternalLink from '@/components/common/ExternalLink' +import useIntervalCounter from '@/hooks/useIntervalCounter' const STATUS_PAGE = 'https://status.safe.global' const MAX_SYNC_DELAY = 1000 * 60 * 5 // 5 minutes +const POLL_INTERVAL = 1000 * 60 // 1 minute const useIndexingStatus = () => { const chainId = useChainId() + const count = useIntervalCounter(POLL_INTERVAL) - return useAsync(() => { - return getIndexingStatus(chainId) - }, [chainId]) + return useAsync( + () => { + return getIndexingStatus(chainId) + }, + [chainId, count], + false, + ) } const STATUSES = { From 1a7536ae855b4a6ee109ccd9136b53c8406cdf50 Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Wed, 22 Jan 2025 12:09:03 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20useIntervalCounter=20returns=20an=20?= =?UTF-8?q?array=20=F0=9F=A4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/components/sidebar/IndexingStatus/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/sidebar/IndexingStatus/index.tsx b/apps/web/src/components/sidebar/IndexingStatus/index.tsx index 5d65d71a2f..c80501473b 100644 --- a/apps/web/src/components/sidebar/IndexingStatus/index.tsx +++ b/apps/web/src/components/sidebar/IndexingStatus/index.tsx @@ -12,7 +12,7 @@ const POLL_INTERVAL = 1000 * 60 // 1 minute const useIndexingStatus = () => { const chainId = useChainId() - const count = useIntervalCounter(POLL_INTERVAL) + const [count] = useIntervalCounter(POLL_INTERVAL) return useAsync( () => {