From 2d4df803e4f5aed838f177a3689155298d6e38d6 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Thu, 14 Jan 2021 01:15:24 +0800 Subject: [PATCH] set account list and transaction overview in store invalid after user profile modified --- src/store/user.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/store/user.js b/src/store/user.js index 197b32e4..39306937 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -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);