mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-11 21:12:29 -05:00
7 lines
199 B
TypeScript
7 lines
199 B
TypeScript
|
export function secondsUntil(timestamp: number | null) {
|
||
|
if (!timestamp) return 0
|
||
|
const seconds = Math.ceil((timestamp - performance.now()) / 1000)
|
||
|
if (seconds > 0) return seconds
|
||
|
return 0
|
||
|
}
|