fixing small bugs; improving background handling and removing dead code
Build and Release to Staging / Build Vision Start (push) Successful in 1m6s
Build and Release to Staging / Build Vision Start Image (push) Successful in 2m41s
Build and Release to Staging / Deploy Vision Start (staging) (push) Successful in 18s

This commit is contained in:
ivanch committed 2026-10-28 21:52:07 -03:00
1 parent 99dbea0615
commit 62e187b9f5
24 files changed
+439 -250

No files matched your search

+5 -3
View File
@@ -12,8 +12,10 @@ interface ClockProps {
};
}
const getMinuteKey = (date: Date): number => Math.floor(date.getTime() / 60_000);
const Clock: React.FC<ClockProps> = ({ config }) => {
const [time, setTime] = useState(new Date());
const [minuteKey, setMinuteKey] = useState(() => getMinuteKey(new Date()));
useEffect(() => {
if (!config.clock.enabled) return;
@@ -23,7 +25,7 @@ const Clock: React.FC<ClockProps> = ({ config }) => {
window.clearTimeout(timeoutId);
if (document.visibilityState !== 'visible') return;
const now = new Date();
setTime(now);
setMinuteKey(getMinuteKey(now));
const msToNextMinute = (60 - now.getSeconds()) * 1000 - now.getMilliseconds();
timeoutId = window.setTimeout(refresh, msToNextMinute);
};
@@ -62,7 +64,7 @@ const Clock: React.FC<ClockProps> = ({ config }) => {
fontFamily: config.clock.font,
}}
>
{formatTime(time)}
{formatTime(new Date(minuteKey * 60_000))}
</div>
);
};