diff --git a/src/components/dao/settings-tokens.vue b/src/components/dao/settings-tokens.vue index de004e64d..cdf25caa4 100644 --- a/src/components/dao/settings-tokens.vue +++ b/src/components/dao/settings-tokens.vue @@ -2,6 +2,7 @@ import { mapActions, mapGetters } from 'vuex' import { validation } from '~/mixins/validation' import currency from 'src/data/currency.json' +import map from '~/utils/map' const mapCurrency = (currency) => (_) => ({ label: `${currency[_]?.symbol} - ${currency[_]?.name}`, @@ -81,7 +82,10 @@ export default { try { const isValid = await this.validate(this.tokens) if (isValid) { - await this.createTokens({ ...this.tokens }) + await this.createTokens({ + ...this.tokens, + voiceDecayPercent: map(this.tokens.voiceDecayPercent, 0, 100, 0, 10000000) + }) } } catch (e) { const message = e.message || e.cause.message @@ -122,7 +126,7 @@ export default { voiceDigits: voiceDigits.split('.')[1].length, voiceTokenMultiplier: this.daoSettings.settings_voiceTokenMultiplier_i, voiceDecayPeriod: this.daoSettings.settings_voiceTokenDecayPeriod_i, - voiceDecayPercent: this.daoSettings.settings_voiceTokenDecayPerPeriodX10M_i + voiceDecayPercent: map(this.daoSettings.settings_voiceTokenDecayPerPeriodX10M_i, 0, 10000000, 0, 100) } } @@ -394,7 +398,7 @@ export default { :disable="selectedDao.hasCustomToken" :filled="selectedDao.hasCustomToken" :placeholder="$t('configuration.settings-tokens.voice.form.decayPercent.placeholder')" - :rules="[rules.required]" + :rules="[rules.required, rules.greaterThan(0), rules.lessOrEqualThan(100)]" color="accent" dense lazy-rules