Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update currency display in setting for change class #15391

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from
28 changes: 16 additions & 12 deletions website/client/src/components/shops/balanceInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div
v-for="currency of currencies"
:key="currency.key"
:needed-currency-only="neededCurrencyOnly"
class="d-flex align-items-center"
>
<div
Expand Down Expand Up @@ -54,6 +55,9 @@
amountNeeded: {
type: Number,
},
neededCurrencyOnly: {
type: Boolean,
},
},
data () {
return {
Expand All @@ -66,34 +70,34 @@
},
computed: {
currencies () {
const currencies = [];
currencies.push({
const currencies = [{
type: 'hourglasses',
icon: this.icons.hourglasses,
value: this.userHourglasses,
});
},

currencies.push({
{
type: 'gems',
icon: this.icons.gem,
value: this.userGems,
});
},

currencies.push({
{
type: 'gold',
icon: this.icons.gold,
value: this.userGold,
});
}];

for (const currency of currencies) {
if (
currency.type === this.currencyNeeded
&& !this.enoughCurrency(this.currencyNeeded, this.amountNeeded)
) {
if (currency.find(type => type === this.currencyNeeded)
&& this.neededCurrencyOnly) {
console.log(this.currencies);

Check failure on line 94 in website/client/src/components/shops/balanceInfo.vue

View workflow job for this annotation

GitHub Actions / production-build (21.x)

Unexpected console statement
}
if (currency.type === this.currencyNeeded
&& !this.enoughCurrency(this.currencyNeeded, this.amountNeeded)) {
currency.notEnough = true;
}
}

return currencies;
},
},
Expand Down
4 changes: 4 additions & 0 deletions website/client/src/pages/settings/components/yourBalance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class="balance-info"
:currency-needed="currencyNeeded"
:amount-needed="amountNeeded"
:neededCurrencyOnly="true"
/>
</div>
</template>
Expand All @@ -28,6 +29,9 @@ export default {
amountNeeded: {
type: Number,
},
neededCurrencyOnly: {
type: Boolean,
},
},
};
</script>
Expand Down
Loading