mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(codebase audit): preserve cleanup without regressions
Fix codebase audit regressions while preserving UI/UX behavior and adding review-driven hardening.
This commit is contained in:
@@ -18,7 +18,10 @@ export const useCurrentTime = (updateIntervalSeconds: number | false = 60) => {
|
||||
|
||||
// Update periodically
|
||||
const intervalId = setInterval(() => {
|
||||
setCurrentTime(Date.now() / 1000);
|
||||
setCurrentTime((previousTime) => {
|
||||
const nextTime = Date.now() / 1000;
|
||||
return Math.floor(nextTime) === Math.floor(previousTime) ? previousTime : nextTime;
|
||||
});
|
||||
}, updateIntervalSeconds * 1000);
|
||||
|
||||
return () => clearInterval(intervalId);
|
||||
|
||||
Reference in New Issue
Block a user