We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6051a12 commit 77d1d24Copy full SHA for 77d1d24
src/GZCTF/ClientApp/src/utils/useGame.ts
@@ -10,8 +10,8 @@ export const getGameStatus = (game?: DetailedGameInfoModel) => {
10
const total = endTime.diff(startTime, 'minute')
11
const current = dayjs().diff(startTime, 'minute')
12
13
- const finished = current > total
14
- const started = current > 0
+ const finished = dayjs().isAfter(endTime)
+ const started = dayjs().isAfter(startTime)
15
const progress = started ? (finished ? 1 : current / total) : 0
16
const status = started ? (finished ? GameStatus.Ended : GameStatus.OnGoing) : GameStatus.Coming
17
0 commit comments