From ce8d1611783d82da7d9c6accc0eee223a263210a Mon Sep 17 00:00:00 2001 From: Kristof Csillag Date: Wed, 28 Jun 2023 11:46:48 +0200 Subject: [PATCH] Freshness test: look at latest block time, not latst update --- src/app/components/OfflineBanner/hook.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/OfflineBanner/hook.ts b/src/app/components/OfflineBanner/hook.ts index 9183e26f10..dd1130848b 100644 --- a/src/app/components/OfflineBanner/hook.ts +++ b/src/app/components/OfflineBanner/hook.ts @@ -25,7 +25,7 @@ export const useRuntimeFreshness = (scope: SearchScope): FreshnessInfo => { throw new AppError(AppErrors.UnsupportedLayer) } const query = useGetRuntimeStatus(scope.network, scope.layer) - const timeDistance = useFormattedTimestampString(query?.data?.data.latest_update) + const timeDistance = useFormattedTimestampString(query?.data?.data.latest_block_time) if (query.isLoading) { return { outOfDate: undefined, @@ -51,7 +51,7 @@ export const useRuntimeFreshness = (scope: SearchScope): FreshnessInfo => { outOfDate: true, } } - const timeSinceLastUpdate = query.dataUpdatedAt - new Date(data.latest_update).getTime() + const timeSinceLastUpdate = query.dataUpdatedAt - new Date(data.latest_block_time).getTime() const { outOfDateThreshold } = paraTimesConfig[scope.layer] return { outOfDate: timeSinceLastUpdate > outOfDateThreshold,