refactor: update tick interval for real-time display in dashboard components and enhance live indicator in Chart component
This commit is contained in:
@@ -138,9 +138,9 @@ export default function SiteDashboardPage() {
|
||||
return () => clearInterval(interval)
|
||||
}, [siteId, dateRange, todayInterval, multiDayInterval, isSettingsLoaded])
|
||||
|
||||
// * Tick every 5s to refresh "Updated X ago" display
|
||||
// * Tick every 1s so "Live · Xs ago" counts in real time
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => setTick((t) => t + 1), 5000)
|
||||
const interval = setInterval(() => setTick((t) => t + 1), 1000)
|
||||
return () => clearInterval(interval)
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user