set account list and transaction overview in store invalid after user profile modified

This commit is contained in:
MaysWind
2021-01-14 01:15:24 +08:00
parent 34ab42c09e
commit 2d4df803e4
+12 -1
View File
@@ -8,7 +8,10 @@ import {
RESET_STATE,
STORE_USER_INFO,
CLEAR_USER_INFO
CLEAR_USER_INFO,
UPDATE_ACCOUNT_LIST_INVALID_STATE,
UPDATE_TRANSACTION_OVERVIEW_INVALID_STATE
} from './mutations.js';
export function authorize(context, { loginName, password }) {
@@ -245,6 +248,14 @@ export function updateUserProfile(context, { profile, currentPassword }) {
context.commit(STORE_USER_INFO, data.result.user);
}
if (!context.state.accountListStateInvalid) {
context.commit(UPDATE_ACCOUNT_LIST_INVALID_STATE, true);
}
if (!context.state.transactionOverviewStateInvalid) {
context.commit(UPDATE_TRANSACTION_OVERVIEW_INVALID_STATE, true);
}
resolve(data.result);
}).catch(error => {
logger.error('failed to save user profile', error);