skip calculating exchange rates when the account balance is 0

This commit is contained in:
MaysWind
2024-12-07 16:48:28 +08:00
parent e549779164
commit d044f938e3
+4
View File
@@ -107,6 +107,10 @@ export const useExchangeRatesStore = defineStore('exchangeRates', {
});
},
getExchangedAmount(amount, fromCurrency, toCurrency) {
if (amount === 0) {
return 0;
}
if (!this.latestExchangeRates || !this.latestExchangeRates.data || !this.latestExchangeRates.data.exchangeRates) {
return null;
}