mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
skip calculating exchange rates when the account balance is 0
This commit is contained in:
@@ -107,6 +107,10 @@ export const useExchangeRatesStore = defineStore('exchangeRates', {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getExchangedAmount(amount, fromCurrency, toCurrency) {
|
getExchangedAmount(amount, fromCurrency, toCurrency) {
|
||||||
|
if (amount === 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.latestExchangeRates || !this.latestExchangeRates.data || !this.latestExchangeRates.data.exchangeRates) {
|
if (!this.latestExchangeRates || !this.latestExchangeRates.data || !this.latestExchangeRates.data.exchangeRates) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user