On the game itself, create a new property called pausedAt: number that holds onto a unix timestamp for when the game was paused. This should be set as soon as a spymaster proposes a clue so that they lose no time while the other spymaster is considering approving/denying the clue.
When the status of the proposed clue changes (including when a spymaster cancels their own clue), delete that field from the game and increment turnEnds by the amount of time the game was paused (Date.now() - pausedAt).
The timer component should just show the remaining time when pausedAt is set (turnEnds - pausedAt) and show a paused icon (maybe <ion-icon name="pause-circle"></ion-icon>?) next to the remaining time with a tooltip indicating that the spymaster is reviewing the clue.
On the game itself, create a new property called
pausedAt: number
that holds onto a unix timestamp for when the game was paused. This should be set as soon as a spymaster proposes a clue so that they lose no time while the other spymaster is considering approving/denying the clue.When the status of the proposed clue changes (including when a spymaster cancels their own clue), delete that field from the game and increment
turnEnds
by the amount of time the game was paused (Date.now() - pausedAt
).The timer component should just show the remaining time when
pausedAt
is set (turnEnds - pausedAt
) and show a paused icon (maybe<ion-icon name="pause-circle"></ion-icon>
?) next to the remaining time with a tooltip indicating that the spymaster is reviewing the clue.