mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 09:44:26 +08:00
support set user default account
This commit is contained in:
@@ -72,6 +72,7 @@ import {
|
||||
resetState,
|
||||
currentUserNickname,
|
||||
currentUserDefaultCurrency,
|
||||
currentUserDefaultAccountId,
|
||||
currentUserFirstDayOfWeek,
|
||||
} from './user.js';
|
||||
|
||||
@@ -208,6 +209,7 @@ const stores = {
|
||||
// user
|
||||
currentUserNickname,
|
||||
currentUserDefaultCurrency,
|
||||
currentUserDefaultAccountId,
|
||||
currentUserFirstDayOfWeek,
|
||||
|
||||
// exchange rates
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user