From b625f64ac99d3533ccd1a879dc1235088fa5b92d Mon Sep 17 00:00:00 2001 From: TheApplePieGod Date: Sun, 14 Jan 2024 16:32:05 -0500 Subject: [PATCH] Client version check immediately --- client/src/components/sidebar/update-warning.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/components/sidebar/update-warning.tsx b/client/src/components/sidebar/update-warning.tsx index dd3b0309..caac34f7 100644 --- a/client/src/components/sidebar/update-warning.tsx +++ b/client/src/components/sidebar/update-warning.tsx @@ -8,7 +8,7 @@ export const UpdateWarning = () => { const [update, setUpdate] = React.useState(undefined) useEffect(() => { - const interval = setInterval(() => { + const fetchVersion = () => { if (!nativeAPI) return nativeAPI .getServerVersion(`${BATTLECODE_YEAR % 100}`) @@ -18,7 +18,10 @@ export const UpdateWarning = () => { } }) .catch(() => {}) - }, 1000 * 60 * UPDATE_CHECK_MINUTES) + } + + fetchVersion() + const interval = setInterval(fetchVersion, 1000 * 60 * UPDATE_CHECK_MINUTES) return () => clearInterval(interval) }, [])