mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 17:40:46 -04:00
it begins
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// Top-level mini summary app shell with hard-refresh timer and alerts.
|
||||
import { useEffect } from 'react';
|
||||
import AlertFeed from '../../components/AlertFeed.jsx';
|
||||
import MiniSummaryContent from './MiniSummaryContent.jsx';
|
||||
import { HARD_REFRESH_MS } from './constants.js';
|
||||
|
||||
export default function MiniSummaryAppRoot() {
|
||||
useEffect(() => {
|
||||
if (typeof window === 'undefined') return undefined;
|
||||
const timer = setTimeout(() => {
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.set('refresh', Date.now().toString());
|
||||
window.location.replace(url.toString());
|
||||
}, HARD_REFRESH_MS);
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<MiniSummaryContent />
|
||||
<AlertFeed scale={3} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user