Skip to content

Commit a74e5ba

Browse files
authored
fix(flat-components): ended timer logic error (#2120)
1 parent f71cc97 commit a74e5ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/flat-components/src/components/ClassroomPage/Timer

packages/flat-components/src/components/ClassroomPage/Timer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const useClockTick = (beginTime: number, expireAt: number | undefined): [TimerSt
5959
return useMemo(() => {
6060
if (beginTime > timestamp) {
6161
return [TimerStatus.Prepare, formatInterval(timestamp, beginTime)];
62-
} else if (expireAt && expireAt - timestamp < 5 * 60_000) {
62+
} else if (expireAt && 0 <= expireAt - timestamp && expireAt - timestamp < 5 * 60_000) {
6363
return [TimerStatus.WillEnd, formatInterval(timestamp, expireAt)];
6464
} else if (expireAt && expireAt < timestamp) {
6565
return [TimerStatus.Ended, formatInterval(expireAt, timestamp)];

0 commit comments

Comments
 (0)