fix: volume sliders
Some checks failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed

Fixed a typo that made a required property be undefined.
Also reduced code duplication.

Fixes #18
This commit is contained in:
Johann150 2022-07-21 01:17:36 +02:00
parent a12acf53ef
commit 9c411d181a
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -1,6 +1,6 @@
<template>
<div class="_formRoot">
<FormRange v-model="masterVolume" :min="0" :max="1" :step="0.05" :text-converter="(v) => `${Math.floor(v * 100)}%`" class="_formBlock">
<FormRange v-model="masterVolume" :min="0" :max="1" :step="0.05" :text-converter="textConverter" class="_formBlock">
<template #label>{{ i18n.ts.masterVolume }}</template>
</FormRange>
@ -77,6 +77,8 @@ const soundsTypes = [
'noizenecio/kick_gaba2',
];
const textConverter = (v) => `${Math.floor(v * 100)}%`;
async function edit(type) {
const { canceled, result } = await os.form(i18n.t('_sfx.' + type), {
type: {
@ -90,10 +92,10 @@ async function edit(type) {
},
volume: {
type: 'range',
mim: 0,
min: 0,
max: 1,
step: 0.05,
textConverter: (v) => `${Math.floor(v * 100)}%`,
textConverter,
label: i18n.ts.volume,
default: sounds.value[type].volume,
},