fix the bug that the overview amounts in home page would not update after changing the first day of week

This commit is contained in:
MaysWind
2024-07-14 18:15:41 +08:00
parent 184dad8185
commit 2cbcc40ca9
2 changed files with 12 additions and 2 deletions
@@ -311,6 +311,7 @@ import { useRootStore } from '@/stores/index.js';
import { useSettingsStore } from '@/stores/setting.js';
import { useUserStore } from '@/stores/user.js';
import { useAccountsStore } from '@/stores/account.js';
import { useOverviewStore } from '@/stores/overview.js';
import datetimeConstants from '@/consts/datetime.js';
import { getNameByKeyValue } from '@/lib/common.js';
@@ -377,7 +378,7 @@ export default {
};
},
computed: {
...mapStores(useRootStore, useSettingsStore, useUserStore, useAccountsStore),
...mapStores(useRootStore, useSettingsStore, useUserStore, useAccountsStore, useOverviewStore),
allLanguages() {
return this.$locale.getAllLanguageInfoArray(true);
},
@@ -537,6 +538,10 @@ export default {
self.saving = false;
if (response.user) {
if (response.user.firstDayOfWeek !== self.oldProfile.firstDayOfWeek) {
this.overviewStore.resetTransactionOverview();
}
self.setCurrentUserProfile(response.user);
self.emailVerified = response.user.emailVerified;