support syncing the settings autoUpdateExchangeRatesData, showAddTransactionButtonInDesktopNavbar, mapCacheExpiration, and exchangeRatesDataCacheExpiration

This commit is contained in:
MaysWind
2026-03-01 21:08:16 +08:00
parent c4c9503e31
commit a84f48ae8a
11 changed files with 118 additions and 84 deletions
+7
View File
@@ -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,