Skip to content

Commit

Permalink
fix: working on displaying only required currency in a new array
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousMagpie committed Feb 14, 2025
1 parent e36dde7 commit 791f565
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
15 changes: 2 additions & 13 deletions website/client/src/components/shops/balanceInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,9 @@ export default {
icon: this.icons.gold,
value: this.userGold,
}];
// need some sort of filter or map function to check currency.type vs neededCurrencyOnly
// and then return a new array; not sure if this is the right approach
for (const currency of currencies) {
if (this.neededCurrencyOnly) {
const neededCurrency = [
// need to figure out how to abstract this so any currency can be called, not just gems
{
type: 'gems',
icon: this.icons.gem,
value: this.userGems,
},
];
return neededCurrency;
}
if (currency.type === this.currencyNeeded
&& !this.enoughCurrency(this.currencyNeeded, this.amountNeeded)) {
currency.notEnough = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class="balance-info"
:currency-needed="currencyNeeded"
:amount-needed="amountNeeded"
neededCurrencyOnly=""
:neededCurrencyOnly="true"
/>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
<your-balance
:amount-needed="amountNeeded"
currency-needed="gems"
:neededCurrencyOnly="true"
/>
</div>
</td>
Expand Down

0 comments on commit 791f565

Please sign in to comment.