fix(striscia): mostra lo zero iniziale solo per la squadra che serve
- All'inizio del set lo 0 compare solo nella riga della squadra che batte; la squadra non servente mostra uno spazio per mantenere l'allineamento dei nomi - cambiaPalla aggiorna la striscia dopo il flip del servizio (a 0-0) - resetta inizializza la striscia in base al servente corrente anziché mostrare 0 per entrambe - Corretto il guard dell'undo: usa storicoServizio.length > 0 invece di striscia.home.length > 1, che avrebbe bloccato l'annulla quando la riga della squadra non servente contiene un solo elemento
This commit is contained in:
@@ -10,7 +10,7 @@ export function createInitialState() {
|
|||||||
visuStriscia: true,
|
visuStriscia: true,
|
||||||
modalitaPartita: "3/5",
|
modalitaPartita: "3/5",
|
||||||
sp: {
|
sp: {
|
||||||
striscia: { home: [0], guest: [0] },
|
striscia: { home: [0], guest: [" "] },
|
||||||
servHome: true,
|
servHome: true,
|
||||||
punt: { home: 0, guest: 0 },
|
punt: { home: 0, guest: 0 },
|
||||||
set: { home: 0, guest: 0 },
|
set: { home: 0, guest: 0 },
|
||||||
@@ -84,7 +84,7 @@ export function applyAction(state, action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case "decPunt": {
|
case "decPunt": {
|
||||||
if (s.sp.striscia.home.length > 1 && s.sp.storicoServizio.length > 0) {
|
if (s.sp.storicoServizio.length > 0) {
|
||||||
const tmpHome = s.sp.striscia.home.pop()
|
const tmpHome = s.sp.striscia.home.pop()
|
||||||
s.sp.striscia.guest.pop()
|
s.sp.striscia.guest.pop()
|
||||||
const statoServizio = s.sp.storicoServizio.pop()
|
const statoServizio = s.sp.storicoServizio.pop()
|
||||||
@@ -118,6 +118,9 @@ export function applyAction(state, action) {
|
|||||||
case "cambiaPalla": {
|
case "cambiaPalla": {
|
||||||
if (s.sp.punt.home === 0 && s.sp.punt.guest === 0) {
|
if (s.sp.punt.home === 0 && s.sp.punt.guest === 0) {
|
||||||
s.sp.servHome = !s.sp.servHome
|
s.sp.servHome = !s.sp.servHome
|
||||||
|
s.sp.striscia = s.sp.servHome
|
||||||
|
? { home: [0], guest: [" "] }
|
||||||
|
: { home: [" "], guest: [0] }
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -132,7 +135,9 @@ export function applyAction(state, action) {
|
|||||||
home: ["1", "2", "3", "4", "5", "6"],
|
home: ["1", "2", "3", "4", "5", "6"],
|
||||||
guest: ["1", "2", "3", "4", "5", "6"],
|
guest: ["1", "2", "3", "4", "5", "6"],
|
||||||
}
|
}
|
||||||
s.sp.striscia = { home: [0], guest: [0] }
|
s.sp.striscia = s.sp.servHome
|
||||||
|
? { home: [0], guest: [" "] }
|
||||||
|
: { home: [" "], guest: [0] }
|
||||||
s.sp.storicoServizio = []
|
s.sp.storicoServizio = []
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user