add parts of statistics ui

This commit is contained in:
MaysWind
2021-01-21 00:55:05 +08:00
parent 1f829f0225
commit 6f4bacd544
14 changed files with 468 additions and 16 deletions
+10 -1
View File
@@ -13,7 +13,8 @@ import {
UPDATE_ACCOUNT_LIST_INVALID_STATE,
UPDATE_TRANSACTION_CATEGORY_LIST_INVALID_STATE,
UPDATE_TRANSACTION_TAG_LIST_INVALID_STATE,
UPDATE_TRANSACTION_OVERVIEW_INVALID_STATE
UPDATE_TRANSACTION_OVERVIEW_INVALID_STATE,
UPDATE_TRANSACTION_STATISTICS_INVALID_STATE
} from './mutations.js';
export function authorize(context, { loginName, password }) {
@@ -258,6 +259,10 @@ export function updateUserProfile(context, { profile, currentPassword }) {
context.commit(UPDATE_TRANSACTION_OVERVIEW_INVALID_STATE, true);
}
if (!context.state.transactionStatisticsStateInvalid) {
context.commit(UPDATE_TRANSACTION_STATISTICS_INVALID_STATE, true);
}
resolve(data.result);
}).catch(error => {
logger.error('failed to save user profile', error);
@@ -301,6 +306,10 @@ export function clearUserData(context, { password }) {
context.commit(UPDATE_TRANSACTION_OVERVIEW_INVALID_STATE, true);
}
if (!context.state.transactionStatisticsStateInvalid) {
context.commit(UPDATE_TRANSACTION_STATISTICS_INVALID_STATE, true);
}
resolve(data.result);
}).catch(error => {
logger.error('failed to clear user data', error);