diff --git a/src/util/misc.ts b/src/util/misc.ts index bd372a45..04350a59 100644 --- a/src/util/misc.ts +++ b/src/util/misc.ts @@ -7,9 +7,10 @@ import Fuse from "fuse.js" import logger from "src/util/logger" export const timestamp1: Readable = derived([], (_, set) => { - setInterval(() => { + const interval = setInterval(() => { set(Math.floor(Date.now() / 1000)) }, 1000) + return () => clearInterval(interval) }) export const secondsToDate = ts => new Date(parseInt(ts) * 1000)