mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 01:04:25 +08:00
support syncing the settings autoUpdateExchangeRatesData, showAddTransactionButtonInDesktopNavbar, mapCacheExpiration, and exchangeRatesDataCacheExpiration
This commit is contained in:
@@ -8,6 +8,7 @@ import { useExchangeRatesStore } from '@/stores/exchangeRates.ts';
|
||||
|
||||
import type { AuthResponse } from '@/models/auth_response.ts';
|
||||
|
||||
import { updateMapCacheExpiration } from '@/lib/cache.ts';
|
||||
import { getOAuth2Provider, getOIDCCustomDisplayNames, getLoginPageTips } from '@/lib/server_settings.ts';
|
||||
import { getClientDisplayVersion } from '@/lib/version.ts';
|
||||
import { setExpenseAndIncomeAmountColor } from '@/lib/ui/common.ts';
|
||||
@@ -54,9 +55,9 @@ export function useLoginPageBase(platform: 'mobile' | 'desktop') {
|
||||
setExpenseAndIncomeAmountColor(authResponse.user.expenseAmountColor, authResponse.user.incomeAmountColor);
|
||||
}
|
||||
|
||||
if (settingsStore.appSettings.autoUpdateExchangeRatesData) {
|
||||
exchangeRatesStore.getLatestExchangeRates({ silent: true, force: false });
|
||||
}
|
||||
updateMapCacheExpiration(settingsStore.appSettings.mapCacheExpiration);
|
||||
exchangeRatesStore.removeExpiredExchangeRates(true);
|
||||
exchangeRatesStore.autoUpdateExchangeRatesData();
|
||||
|
||||
if (authResponse.notificationContent) {
|
||||
rootStore.setNotificationContent(authResponse.notificationContent);
|
||||
|
||||
@@ -10,6 +10,8 @@ import { useExchangeRatesStore } from '@/stores/exchangeRates.ts';
|
||||
import { CategoryType } from '@/core/category.ts';
|
||||
import type { RegisterResponse } from '@/models/auth_response.ts';
|
||||
import type { User } from '@/models/user.ts';
|
||||
|
||||
import { updateMapCacheExpiration } from '@/lib/cache.ts';
|
||||
import { setExpenseAndIncomeAmountColor } from '@/lib/ui/common.ts';
|
||||
|
||||
export function useSignupPageBase() {
|
||||
@@ -114,9 +116,9 @@ export function useSignupPageBase() {
|
||||
setExpenseAndIncomeAmountColor(response.user.expenseAmountColor, response.user.incomeAmountColor);
|
||||
}
|
||||
|
||||
if (settingsStore.appSettings.autoUpdateExchangeRatesData) {
|
||||
exchangeRatesStore.getLatestExchangeRates({ silent: true, force: false });
|
||||
}
|
||||
updateMapCacheExpiration(settingsStore.appSettings.mapCacheExpiration);
|
||||
exchangeRatesStore.removeExpiredExchangeRates(true);
|
||||
exchangeRatesStore.autoUpdateExchangeRatesData();
|
||||
|
||||
if (response.notificationContent) {
|
||||
rootStore.setNotificationContent(response.notificationContent);
|
||||
|
||||
@@ -11,6 +11,7 @@ import { useExchangeRatesStore } from '@/stores/exchangeRates.ts';
|
||||
|
||||
import { isWebAuthnSupported } from '@/lib/webauthn.ts';
|
||||
import { hasWebAuthnConfig } from '@/lib/userstate.ts';
|
||||
import { updateMapCacheExpiration } from '@/lib/cache.ts';
|
||||
import { getClientDisplayVersion } from '@/lib/version.ts';
|
||||
import { setExpenseAndIncomeAmountColor } from '@/lib/ui/common.ts';
|
||||
|
||||
@@ -48,14 +49,14 @@ export function useUnlockPageBase() {
|
||||
setExpenseAndIncomeAmountColor(response.user.expenseAmountColor, response.user.incomeAmountColor);
|
||||
}
|
||||
|
||||
updateMapCacheExpiration(settingsStore.appSettings.mapCacheExpiration);
|
||||
exchangeRatesStore.removeExpiredExchangeRates(true);
|
||||
exchangeRatesStore.autoUpdateExchangeRatesData();
|
||||
|
||||
if (response.notificationContent) {
|
||||
rootStore.setNotificationContent(response.notificationContent);
|
||||
}
|
||||
});
|
||||
|
||||
if (settingsStore.appSettings.autoUpdateExchangeRatesData) {
|
||||
exchangeRatesStore.getLatestExchangeRates({ silent: true, force: false });
|
||||
}
|
||||
}
|
||||
|
||||
function doRelogin(): void {
|
||||
|
||||
@@ -23,7 +23,14 @@ export const ALL_APPLICATION_CLOUD_SETTINGS: CategorizedApplicationCloudSettingI
|
||||
{
|
||||
categoryName: 'Basic Settings',
|
||||
items: [
|
||||
{ settingKey: 'showAccountBalance', settingName: 'Show Account Balance', mobile: true, desktop: true }
|
||||
{ settingKey: 'showAccountBalance', settingName: 'Show Account Balance', mobile: true, desktop: true },
|
||||
{ settingKey: 'autoUpdateExchangeRatesData', settingName: 'Auto-update Exchange Rates Data', mobile: true, desktop: true }
|
||||
]
|
||||
},
|
||||
{
|
||||
categoryName: 'Navigation Bar',
|
||||
items: [
|
||||
{ settingKey: 'showAddTransactionButtonInDesktopNavbar', settingName: 'Show Add Transaction Button', mobile: false, desktop: true }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -78,6 +85,13 @@ export const ALL_APPLICATION_CLOUD_SETTINGS: CategorizedApplicationCloudSettingI
|
||||
{ settingKey: 'currencySortByInExchangeRatesPage', settingName: 'Sort by', mobile: true, desktop: true }
|
||||
]
|
||||
},
|
||||
{
|
||||
categoryName: 'Browser Cache Management',
|
||||
items: [
|
||||
{ settingKey: 'mapCacheExpiration', settingName: 'Cache Expiration for Map Data', mobile: true, desktop: true },
|
||||
{ settingKey: 'exchangeRatesDataCacheExpiration', settingName: 'Cache Expiration for Exchange Rates Data', mobile: true, desktop: true }
|
||||
]
|
||||
},
|
||||
{
|
||||
categoryName: 'Statistics Settings',
|
||||
categorySubName: 'Common Settings',
|
||||
|
||||
Reference in New Issue
Block a user