perf: Fix unnecessary renders in useCurrentTime hook and ModQueueView footer

This commit is contained in:
plebeius
2026-01-08 17:16:29 +01:00
parent 402313107c
commit 404b613b44
2 changed files with 23 additions and 12 deletions
+1 -4
View File
@@ -12,10 +12,7 @@ export const useCurrentTime = (updateIntervalSeconds = 60) => {
const [currentTime, setCurrentTime] = useState(() => Date.now() / 1000);
useEffect(() => {
// Update immediately on mount
setCurrentTime(Date.now() / 1000);
// Then update periodically
// Update periodically
const intervalId = setInterval(() => {
setCurrentTime(Date.now() / 1000);
}, updateIntervalSeconds * 1000);