diff --git a/interface/src/app/settings/Version.tsx b/interface/src/app/settings/Version.tsx index 58a784731..461a65123 100644 --- a/interface/src/app/settings/Version.tsx +++ b/interface/src/app/settings/Version.tsx @@ -1,4 +1,4 @@ -import { memo, useContext, useState } from 'react'; +import { memo, useContext, useEffect, useState } from 'react'; import { Link } from 'react-router'; import CancelIcon from '@mui/icons-material/Cancel'; @@ -412,7 +412,7 @@ const getPlatform = (data: VersionData): string => { const Version = () => { const { LL, locale } = useI18nContext(); - const { me, versions } = useContext(AuthenticatedContext); + const { me, versions, refreshVersions } = useContext(AuthenticatedContext); const [restarting, setRestarting] = useState(false); const [confirmFactoryReset, setConfirmFactoryReset] = useState(false); @@ -441,6 +441,16 @@ const Version = () => { const devUpgradeAvailable = versions?.dev?.upgradeable ?? false; const internetLive = Boolean(versions?.stable || versions?.dev); + useEffect(() => { + if (internetLive) { + return; + } + const interval = setInterval(() => { + void refreshVersions(); + }, 3000); + return () => clearInterval(interval); + }, [internetLive, refreshVersions]); + const { send: sendSetPartition } = useRequest( (partition: string) => callAction({ action: 'setPartition', param: partition }), { immediate: false }