diff --git a/src/components/dao/settings-tokens.vue b/src/components/dao/settings-tokens.vue index de004e64d..d13e62fce 100644 --- a/src/components/dao/settings-tokens.vue +++ b/src/components/dao/settings-tokens.vue @@ -95,6 +95,7 @@ export default { const [treasuryDigits, treasurySymbol] = this.daoSettings.settings_pegToken_a.split(' ') const [utilityDigits, utilitySymbol] = this.daoSettings.settings_rewardToken_a.split(' ') const [voiceDigits, voiceSymbol] = this.daoSettings.settings_voiceToken_a.split(' ') + const [utilityAmount] = this.daoSettings?.settings_rewardTokenMaxSupply_a?.split(' ') this.tokens = { // ...this.tokens, @@ -113,7 +114,7 @@ export default { utilitySymbol, utilityDigits: utilityDigits.split('.')[1].length, // 1.0, 1.00, 1.000, // 1.0, 1.00, 1.000 utilityTokenMultiplier: this.daoSettings.settings_utilityTokenMultiplier_i, - utilityAmount: this.daoSettings.settings_rewardTokenMaxSupply_a, // i.e 100000 or -1 for infinite supply + utilityAmount: parseInt(utilityAmount) === -1 ? '∞' : utilityAmount, // i.e 100000 or -1 for infinite supply // // utilityValue: '1', // The equivalent value of 1 token in USD // // Voice token @@ -145,18 +146,18 @@ export default { } }, immediate: true - }, - - 'tokens.treasuryCurrency': { - handler: function (value) { - if (value) { - this.tokens.treasuryName = value?.name - this.tokens.treasurySymbol = value?.code - } - }, - immediate: true } + // 'tokens.treasuryCurrency': { + // handler: function (value) { + // if (value) { + // this.tokens.treasuryName = value?.name + // this.tokens.treasurySymbol = value?.code + // } + // }, + // immediate: true + // } + } } @@ -180,11 +181,16 @@ export default { .col-12.col-md-6 label.h-label {{ $t('configuration.settings-tokens.tresury.form.name.label') }} q-input.q-my-xs( + :debounce="200" + :disable="selectedDao.hasCustomToken" + :filled="selectedDao.hasCustomToken" + :placeholder="$t('configuration.settings-tokens.utility.form.name.placeholder')" :rules="[rules.required]" + color="accent" dense - disable - filled lazy-rules + outlined + ref="treasuryName" rounded v-model='tokens.treasuryName' ) @@ -193,13 +199,19 @@ export default { .col-12.col-md-6 label.h-label {{ $t('configuration.settings-tokens.tresury.form.symbol.label') }} q-input.q-my-xs( - :rules="[rules.required]" + :debounce="200" + :disable="selectedDao.hasCustomToken" + :filled="selectedDao.hasCustomToken" + :placeholder="$t('configuration.settings-tokens.utility.form.symbol.placeholder')" + :rules="[rules.required, rules.isTokenAvailable]" dense - disable - filled lazy-rules + mask="AAAAAAAA" + maxlength="7" + outlined + ref="treasurySymbol" rounded - v-model='tokens.treasurySymbol' + v-model="tokens.treasurySymbol" ) q-tooltip(:content-style="{ 'font-size': '1em' }" anchor="top middle" self="bottom middle" v-if="!selectedDao.hasCustomToken") {{ $t('common.onlyDaoAdmins') }} diff --git a/src/pages/proposals/create/StepPayout.vue b/src/pages/proposals/create/StepPayout.vue index d2984beb1..18913bbb3 100644 --- a/src/pages/proposals/create/StepPayout.vue +++ b/src/pages/proposals/create/StepPayout.vue @@ -104,7 +104,7 @@ export default { }, computed: { - ...mapGetters('dao', ['daoSettings']), + ...mapGetters('dao', ['daoSettings', 'selectedDao']), nextDisabled () { const proposalType = this.$store.state.proposals.draft.category.key @@ -407,7 +407,7 @@ widget(:class="{ 'disable-step': currentStepName !== 'step-payout' && $q.screen. .row(v-if="isAssignment") label.text-bold {{ toggle ? $t('pages.proposals.create.steppayout.compensationForOnePeriod') : $t('pages.proposals.create.steppayout.compensationForOneCycle') }} .q-col-gutter-xs.q-mt-sm(:class="{ 'q-mt-xxl':$q.screen.lt.md || $q.screen.md, 'row':$q.screen.gt.md }") - .col-4(:class="{ 'q-mt-md':$q.screen.lt.md || $q.screen.md }" v-if="fields.reward") + .col-4(:class="{ 'q-mt-md':$q.screen.lt.md || $q.screen.md }" v-if="fields.reward && selectedDao.hasCustomToken") label.h-label(v-if="$store.state.dao.settings.rewardToken !== 'HYPHA'") {{ `${fields.reward.label} (${$store.state.dao.settings.rewardToken})` }} label.h-label(v-else) {{ `${fields.reward.label}` }} .row.full-width.items-center.q-mt-xs @@ -415,7 +415,7 @@ widget(:class="{ 'disable-step': currentStepName !== 'step-payout' && $q.screen. q-input.rounded-border.col(dense :readonly="!custom" outlined v-model="utilityToken" rounded v-if="isAssignment && !isFounderRole") q-input.rounded-border.col(dense :readonly="!custom" outlined v-model="reward" rounded v-else) .col-4(:class="{ 'q-mt-md':$q.screen.lt.md || $q.screen.md }" v-if="fields.peg") - label.h-label(v-if="$store.state.dao.settings.pegToken !== 'HUSD'") {{ `${fields.peg.label} (${$store.state.dao.settings.pegToken})` }} + label.h-label(v-if="$store.state.dao.settings.pegToken !== 'HUSD'") {{ `${fields.peg.label} ${$store.state.dao.settings.pegToken ? `(${$store.state.dao.settings.pegToken})`:''}`}} label.h-label(v-else) {{ `${fields.peg.label}` }} .row.full-width.items-center.q-mt-xs token-logo.q-mr-xs(size="40px" type="cash" :daoLogo="daoSettings.logo") diff --git a/src/store/dao/actions.js b/src/store/dao/actions.js index ba03020e7..97a536ef5 100644 --- a/src/store/dao/actions.js +++ b/src/store/dao/actions.js @@ -1033,8 +1033,8 @@ export const createTokens = async function ({ state, rootState }, data) { // voice token [ { label: 'content_group_label', value: ['string', 'voice_details'] }, - { label: 'voice_token_decay_period', value: ['int64', 604800] }, - { label: 'voice_token_decay_per_period_x10M', value: ['int64', 100000] }, + { label: 'voice_token_decay_period', value: ['int64', data?.voiceDecayPeriod] }, + { label: 'voice_token_decay_per_period_x10M', value: ['int64', data?.voiceDecayPercent] }, { label: 'voice_token_multiplier', value: ['int64', data?.voiceTokenMultiplier] } ] ]