mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
719da5fbd8
IDE page: connection manager and loading screen GitOrigin-RevId: 2cbc8c09aeb36a14eae66da78b267c7a830fb71a
6 lines
199 B
TypeScript
6 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
|
|
}
|