mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 09:14:27 +08:00
support syncing the settings autoUpdateExchangeRatesData, showAddTransactionButtonInDesktopNavbar, mapCacheExpiration, and exchangeRatesDataCacheExpiration
This commit is contained in:
@@ -169,6 +169,12 @@ export const useExchangeRatesStore = defineStore('exchangeRates', () => {
|
||||
clearExchangeRatesFromLocalStorage();
|
||||
}
|
||||
|
||||
function autoUpdateExchangeRatesData(): void {
|
||||
if (settingsStore.appSettings.autoUpdateExchangeRatesData) {
|
||||
getLatestExchangeRates({ silent: true, force: false });
|
||||
}
|
||||
}
|
||||
|
||||
function getLatestExchangeRates({ silent, force }: { silent: boolean, force: boolean }): Promise<LatestExchangeRateResponse> {
|
||||
const currentExchangeRateData = latestExchangeRates.value;
|
||||
const now = getCurrentUnixTime();
|
||||
@@ -331,6 +337,7 @@ export const useExchangeRatesStore = defineStore('exchangeRates', () => {
|
||||
getExchangeRatesCacheSize,
|
||||
removeExpiredExchangeRates,
|
||||
resetLatestExchangeRates,
|
||||
autoUpdateExchangeRatesData,
|
||||
getLatestExchangeRates,
|
||||
updateUserCustomExchangeRate,
|
||||
deleteUserCustomExchangeRate,
|
||||
|
||||
Reference in New Issue
Block a user