Limita il cambio palla solo a inizio set (0-0)

- Aggiunge computed property isPunteggioZeroZero per verificare lo stato del punteggio
- Crea metodo cambiaPalla() con validazione che blocca il cambio se il punteggio non è 0-0
- Disabilita il pulsante cambio palla quando il punteggio non è 0-0
- Mostra notifica di avviso se si tenta il cambio palla durante il set
- Aggiorna scorciatoia tastiera Ctrl+ArrowLeft per usare la stessa validazione
This commit is contained in:
2026-01-26 13:45:22 +01:00
parent bbe0862241
commit 6c6ac7fc29
2 changed files with 14 additions and 2 deletions

View File

@@ -149,7 +149,7 @@
<w-button @click="apriDialogConfig()">
<img src="/gear.png" width="25" />
</w-button>
<w-button @click="sp.servHome = !sp.servHome">
<w-button @click="cambiaPalla" :disabled="!isPunteggioZeroZero">
<img src="/serv.png" width="25" />
</w-button>
<w-confirm top left question="Azzero punteggio ?" cancel="NO" confirm="SI" @confirm="resetta">

View File

@@ -38,6 +38,11 @@ export default {
}
this.abilitaTastiSpeciali();
},
computed: {
isPunteggioZeroZero() {
return this.sp.punt.home === 0 && this.sp.punt.guest === 0;
}
},
methods: {
closeApp() {
var win = window.open("", "_self");
@@ -69,6 +74,13 @@ export default {
this.sp.striscia = { home: [0], guest: [0] }
this.sp.servizioPrecedente = []
},
cambiaPalla() {
if (!this.isPunteggioZeroZero) {
this.$waveui.notify("Cambio palla consentito solo a inizio set (0-0)", "warning");
return;
}
this.sp.servHome = !this.sp.servHome;
},
incSet(team) {
if (this.sp.set[team] == 2) {
this.sp.set[team] = 0;
@@ -216,7 +228,7 @@ export default {
} else if (e.shiftKey && e.key == "ArrowRight") {
this.incSet("guest")
} else if (e.ctrlKey && e.key == "ArrowLeft") {
this.sp.servHome = !this.sp.servHome
this.cambiaPalla()
} else { return false }
}
}