Les pénalités ne se suivent pas d'une tentative à une autre

This commit is contained in:
2024-12-14 13:35:09 +01:00
parent 979362d012
commit cb1222d9cf
3 changed files with 7 additions and 1 deletions

View File

@ -101,7 +101,7 @@ export default function GameProvider({ children }: { children: ReactNode }) {
const activeChallenge: ChallengeAction | undefined = challengeActions
.find(challengeAction => challengeAction.penaltyStart && challengeAction.penaltyEnd
&& challengeAction.penaltyStart <= now && now <= challengeAction.penaltyEnd)
if (!activeChallenge || !game.currentRunner)
if (!activeChallenge || !game.currentRunner || game.runId !== activeChallenge.runId)
updatePenalty({ penaltyStart: null, penaltyEnd: null })
else if (activeChallenge && (activeChallenge.penaltyStart !== game.penaltyStart || activeChallenge.penaltyEnd)) {
updatePenalty({ penaltyStart: activeChallenge.penaltyStart, penaltyEnd: activeChallenge.penaltyEnd })