From 6c6ac7fc291b2c75f9fe41bc40d6e0269a3e5952 Mon Sep 17 00:00:00 2001 From: davide3011 Date: Mon, 26 Jan 2026 13:45:22 +0100 Subject: [PATCH] Limita il cambio palla solo a inizio set (0-0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/components/HomePage/HomePage.html | 2 +- src/components/HomePage/HomePage.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/HomePage/HomePage.html b/src/components/HomePage/HomePage.html index 2298f88..a179fb1 100644 --- a/src/components/HomePage/HomePage.html +++ b/src/components/HomePage/HomePage.html @@ -149,7 +149,7 @@ - + diff --git a/src/components/HomePage/HomePage.js b/src/components/HomePage/HomePage.js index 1c9a871..0741da9 100644 --- a/src/components/HomePage/HomePage.js +++ b/src/components/HomePage/HomePage.js @@ -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 } } }