diff --git a/frontend/src/components/Chooser.vue b/frontend/src/components/Chooser.vue index 22fe758..785144c 100644 --- a/frontend/src/components/Chooser.vue +++ b/frontend/src/components/Chooser.vue @@ -3,12 +3,12 @@
{{hintText}}
- +{{desc}}
@@ -72,7 +72,15 @@ export default { this.select(this.cards[0]); window.clearInterval(this.intervalID); } - } + }, + internalCancel() { + if (this.intervalID) window.clearInterval(this.intervalID); + this.cancel(); + }, + internalSelect(card) { + if (this.intervalID) window.clearInterval(this.intervalID); + this.select(card); + }, }, mounted() { this.realCancelText = this.cancelText @@ -85,11 +93,10 @@ export default { if (this.playAudio) { (new Audio(show_sfx)).play(); } - if (this.timer > 0) { - this.remainingTime = this.timer; - this.intervalID = window.setInterval(() => { - this.countDown(); - }, 1000); + this.remainingTime = this.timer; + if (this.timer != 0 && this.remainingTime == this.timer) { + if (this.intervalID) window.clearInterval(this.intervalID); + this.intervalID = window.setInterval(this.countDown, 1000); } }, } diff --git a/frontend/src/components/Player.vue b/frontend/src/components/Player.vue index f29f459..39bdfdb 100644 --- a/frontend/src/components/Player.vue +++ b/frontend/src/components/Player.vue @@ -50,15 +50,15 @@