feat(timeout): sostituisci toggleTimeout con startTimeout/stopTimeout e auto-chiusura a 30s
Serve una squadra richiedente e un video selezionabile, non più un semplice flag. Il timer dei 30s è armato lato server (non nel controller) così sopravvive a refresh/disconnessione/standby del tablet che pilota il gioco.
This commit is contained in:
+18
-2
@@ -22,6 +22,9 @@ export function createInitialState() {
|
||||
visuForm: false,
|
||||
visuStriscia: true,
|
||||
timeout: false,
|
||||
timeoutTeam: null,
|
||||
timeoutVideo: null,
|
||||
timeoutStartedAt: null,
|
||||
modalitaPartita: "3/5",
|
||||
sp: {
|
||||
striscia: [{ serv: 'h', ris: '', vinc: null }],
|
||||
@@ -165,8 +168,21 @@ export function applyAction(state, action) {
|
||||
break
|
||||
}
|
||||
|
||||
case "toggleTimeout": {
|
||||
s.timeout = !s.timeout
|
||||
case "startTimeout": {
|
||||
const team = action.team
|
||||
if (team !== 'home' && team !== 'guest') break
|
||||
s.timeout = true
|
||||
s.timeoutTeam = team
|
||||
s.timeoutVideo = action.video ?? null
|
||||
s.timeoutStartedAt = action.startedAt ?? null
|
||||
break
|
||||
}
|
||||
|
||||
case "stopTimeout": {
|
||||
s.timeout = false
|
||||
s.timeoutTeam = null
|
||||
s.timeoutVideo = null
|
||||
s.timeoutStartedAt = null
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user