We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bee94a5 + b625f64 commit 1e12bf6Copy full SHA for 1e12bf6
client/src/components/sidebar/update-warning.tsx
@@ -8,7 +8,7 @@ export const UpdateWarning = () => {
8
const [update, setUpdate] = React.useState<undefined | { latest: string }>(undefined)
9
10
useEffect(() => {
11
- const interval = setInterval(() => {
+ const fetchVersion = () => {
12
if (!nativeAPI) return
13
nativeAPI
14
.getServerVersion(`${BATTLECODE_YEAR % 100}`)
@@ -18,7 +18,10 @@ export const UpdateWarning = () => {
18
}
19
})
20
.catch(() => {})
21
- }, 1000 * 60 * UPDATE_CHECK_MINUTES)
+ }
22
+
23
+ fetchVersion()
24
+ const interval = setInterval(fetchVersion, 1000 * 60 * UPDATE_CHECK_MINUTES)
25
26
return () => clearInterval(interval)
27
}, [])
0 commit comments