Skip to content

Commit

Permalink
fix(settings-token): add correct maping for decay
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenijesavic committed Sep 8, 2023
1 parent 0a9dce5 commit 7da7192
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/dao/settings-tokens.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7da7192

Please sign in to comment.