support set user default account

This commit is contained in:
MaysWind
2022-04-18 00:16:47 +08:00
parent c5a101aad2
commit 9a79606565
12 changed files with 112 additions and 16 deletions
+6
View File
@@ -236,6 +236,7 @@ export function updateUserProfile(context, { profile, currentPassword }) {
email: profile.email,
nickname: profile.nickname,
defaultCurrency: profile.defaultCurrency,
defaultAccountId: profile.defaultAccountId,
firstDayOfWeek: profile.firstDayOfWeek,
transactionEditScope: profile.transactionEditScope
}).then(response => {
@@ -346,6 +347,11 @@ export function currentUserDefaultCurrency(state) {
return userInfo.defaultCurrency || state.defaultSetting.currency;
}
export function currentUserDefaultAccountId(state) {
const userInfo = state.currentUserInfo || {};
return userInfo.defaultAccountId || '';
}
export function currentUserFirstDayOfWeek(state) {
const userInfo = state.currentUserInfo || {};
return utils.isNumber(userInfo.firstDayOfWeek) ? userInfo.firstDayOfWeek : state.defaultSetting.firstDayOfWeek;