Skip to content

Commit 77d1d24

Browse files
authored
fix: game starts 1 minute later (#154)
1 parent 6051a12 commit 77d1d24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GZCTF/ClientApp/src/utils/useGame.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export const getGameStatus = (game?: DetailedGameInfoModel) => {
1010
const total = endTime.diff(startTime, 'minute')
1111
const current = dayjs().diff(startTime, 'minute')
1212

13-
const finished = current > total
14-
const started = current > 0
13+
const finished = dayjs().isAfter(endTime)
14+
const started = dayjs().isAfter(startTime)
1515
const progress = started ? (finished ? 1 : current / total) : 0
1616
const status = started ? (finished ? GameStatus.Ended : GameStatus.OnGoing) : GameStatus.Coming
1717

0 commit comments

Comments
 (0)