support user custom exchange rates data

This commit is contained in:
MaysWind
2025-05-26 00:47:19 +08:00
parent c4d20c539f
commit 817291c9a7
41 changed files with 1257 additions and 73 deletions
+6
View File
@@ -378,6 +378,8 @@ export const useRootStore = defineStore('root', () => {
}
function updateUserProfile(req: UserProfileUpdateRequest): Promise<UserProfileUpdateResponse> {
const userDefaultCurrency = userStore.currentUserDefaultCurrency;
return new Promise((resolve, reject) => {
services.updateProfile(req).then(response => {
const data = response.data;
@@ -407,6 +409,10 @@ export const useRootStore = defineStore('root', () => {
statisticsStore.updateTransactionStatisticsInvalidState(true);
}
if (data.result.user && data.result.user.defaultCurrency !== userDefaultCurrency) {
exchangeRatesStore.resetLatestExchangeRates();
}
resolve(data.result);
}).catch(error => {
logger.error('failed to save user profile', error);