Skip to content

Commit

Permalink
fix: removed gold & hourglasses if neededCurrencyOnly is true
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousMagpie committed Feb 7, 2025
1 parent e69078f commit a98572c
Showing 1 changed file with 29 additions and 32 deletions.
61 changes: 29 additions & 32 deletions website/client/src/components/shops/balanceInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,43 +71,40 @@ export default {
computed: {
currencies () {
const currencies = [];
currencies.push({
type: 'hourglasses',
icon: this.icons.hourglasses,
value: this.userHourglasses,
});
if (this.neededCurrencyOnly === true) {
currencies.push({
type: 'gems',
icon: this.icons.gem,
value: this.userGems,
});
} else {
currencies.push({
type: 'hourglasses',
icon: this.icons.hourglasses,
value: this.userHourglasses,
});
currencies.push({
type: 'gems',
icon: this.icons.gem,
value: this.userGems,
});
currencies.push({
type: 'gems',
icon: this.icons.gem,
value: this.userGems,
});
currencies.push({
type: 'gold',
icon: this.icons.gold,
value: this.userGold,
});
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)
) {
currency.notEnough = true;
for (const currency of currencies) {
if (
currency.type === this.currencyNeeded
&& !this.enoughCurrency(this.currencyNeeded, this.amountNeeded)
) {
currency.notEnough = true;
}
}
}
for (const currency of currencies) {
if (
currency.type === this.neededCurrencyOnly
) {
return this.currencyNeeded;
}
}
console.log(currencies);
console.log(this.neededCurrencyOnly);
console.log(this.currencyNeeded);
return currencies;
},
},
Expand Down

0 comments on commit a98572c

Please sign in to comment.