feat: change rate to .1 steps and fix floating (close #40)
All checks were successful
repod / xml (push) Successful in 2m40s
repod / php (push) Successful in 1m7s
repod / nodejs (push) Successful in 2m15s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-01-21 11:33:32 +01:00
parent 9f9fdf4cf0
commit ff23be4f91

View File

@ -8,11 +8,11 @@
</template>
<template #extra>
<div class="extra">
<Minus class="pointer" :size="20" @click="changeRate(-.5)" />
<Minus class="pointer" :size="20" @click="changeRate(-.1)" />
<NcCounterBubble class="counter">
x{{ player.rate }}
</NcCounterBubble>
<Plus class="pointer" :size="20" @click="changeRate(.5)" />
<Plus class="pointer" :size="20" @click="changeRate(.1)" />
</div>
</template>
</NcAppNavigationItem>
@ -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 {