From ff23be4f916c3f2198fe20aec2138ddcc2a505a6 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Sun, 21 Jan 2024 11:33:32 +0100 Subject: [PATCH] feat: change rate to .1 steps and fix floating (close #40) --- src/components/Sidebar/Settings.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Sidebar/Settings.vue b/src/components/Sidebar/Settings.vue index dbd56ac..9333125 100644 --- a/src/components/Sidebar/Settings.vue +++ b/src/components/Sidebar/Settings.vue @@ -8,11 +8,11 @@ @@ -92,9 +92,8 @@ export default { methods: { generateUrl, changeRate(diff) { - if (this.player.rate + diff > 0) { - this.$store.dispatch('player/rate', this.player.rate + diff) - } + const newRate = (this.player.rate + diff).toPrecision(2) + this.$store.dispatch('player/rate', newRate > 0 ? newRate : this.player.rate) }, async importOpml(event) { try {