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:
2026-07-03 10:13:51 +02:00
parent 0441b0c7f5
commit d11b47c809
2 changed files with 52 additions and 3 deletions
+18 -2
View File
@@ -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
}