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) }, [])