Skip to content

Commit

Permalink
fix: game starts 1 minute later (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWQ-monad committed Sep 29, 2023
1 parent 6051a12 commit 77d1d24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GZCTF/ClientApp/src/utils/useGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const getGameStatus = (game?: DetailedGameInfoModel) => {
const total = endTime.diff(startTime, 'minute')
const current = dayjs().diff(startTime, 'minute')

const finished = current > total
const started = current > 0
const finished = dayjs().isAfter(endTime)
const started = dayjs().isAfter(startTime)
const progress = started ? (finished ? 1 : current / total) : 0
const status = started ? (finished ? GameStatus.Ended : GameStatus.OnGoing) : GameStatus.Coming

Expand Down

0 comments on commit 77d1d24

Please sign in to comment.