show message when force update exchange rates data and the data is up to date

This commit is contained in:
MaysWind
2023-04-02 18:06:36 +08:00
parent 5a924fa382
commit 853b01e2ca
4 changed files with 61 additions and 0 deletions
+7
View File
@@ -35,6 +35,13 @@ export function getLatestExchangeRates(context, { silent, force }) {
return;
}
const currentData = getExchangeRatesFromLocalStorage();
if (currentData && currentData.data && utils.isEquals(currentData.data, data.result)) {
reject({ message: 'Exchange rates data is up to date' });
return;
}
context.commit(STORE_LATEST_EXCHANGE_RATES, {
time: now,
data: data.result