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 } } }