automatically reload data after changed display order

This commit is contained in:
MaysWind
2026-03-01 22:25:44 +08:00
parent f5a7e2e2d6
commit 4845fdedfd
5 changed files with 36 additions and 24 deletions
+6 -4
View File
@@ -934,11 +934,13 @@ export const useAccountsStore = defineStore('accounts', () => {
return; return;
} }
if (accountListStateInvalid.value) { loadAllAccounts({ force: false }).finally(() => {
updateAccountListInvalidState(false); if (accountListStateInvalid.value) {
} updateAccountListInvalidState(false);
}
resolve(data.result); resolve(data.result);
});
}).catch(error => { }).catch(error => {
logger.error('failed to save accounts display order', error); logger.error('failed to save accounts display order', error);
+6 -4
View File
@@ -1069,11 +1069,13 @@ export const useExplorersStore = defineStore('explorers', () => {
return; return;
} }
if (insightsExplorerListStateInvalid.value) { loadAllInsightsExplorerBasicInfos({ force: false }).finally(() => {
updateInsightsExplorerListInvalidState(false); if (insightsExplorerListStateInvalid.value) {
} updateInsightsExplorerListInvalidState(false);
}
resolve(data.result); resolve(data.result);
});
}).catch(error => { }).catch(error => {
logger.error('failed to save explorers display order', error); logger.error('failed to save explorers display order', error);
+6 -4
View File
@@ -473,11 +473,13 @@ export const useTransactionCategoriesStore = defineStore('transactionCategories'
return; return;
} }
if (transactionCategoryListStateInvalid.value) { loadAllCategories({ force: false }).finally(() => {
updateTransactionCategoryListInvalidState(false); if (transactionCategoryListStateInvalid.value) {
} updateTransactionCategoryListInvalidState(false);
}
resolve(data.result); resolve(data.result);
});
}).catch(error => { }).catch(error => {
logger.error('failed to save categories display order', error); logger.error('failed to save categories display order', error);
+12 -8
View File
@@ -509,11 +509,13 @@ export const useTransactionTagsStore = defineStore('transactionTags', () => {
return; return;
} }
if (transactionTagGroupListStateInvalid.value) { loadAllTagGroups({ force: false }).finally(() => {
updateTransactionTagGroupListInvalidState(false); if (transactionTagGroupListStateInvalid.value) {
} updateTransactionTagGroupListInvalidState(false);
}
resolve(data.result); resolve(data.result);
});
}).catch(error => { }).catch(error => {
logger.error('failed to save tag groups display order', error); logger.error('failed to save tag groups display order', error);
@@ -705,11 +707,13 @@ export const useTransactionTagsStore = defineStore('transactionTags', () => {
return; return;
} }
if (transactionTagListStateInvalid.value) { loadAllTags({ force: false }).finally(() => {
updateTransactionTagListInvalidState(false); if (transactionTagListStateInvalid.value) {
} updateTransactionTagListInvalidState(false);
}
resolve(data.result); resolve(data.result);
});
}).catch(error => { }).catch(error => {
logger.error('failed to save tags display order', error); logger.error('failed to save tags display order', error);
+6 -4
View File
@@ -334,11 +334,13 @@ export const useTransactionTemplatesStore = defineStore('transactionTemplates',
return; return;
} }
if (!isDefined(transactionTemplateListStatesInvalid.value[templateType]) || transactionTemplateListStatesInvalid.value[templateType]) { loadAllTemplates({ templateType: templateType, force: false }).finally(() => {
updateTransactionTemplateListInvalidState(templateType, false); if (!isDefined(transactionTemplateListStatesInvalid.value[templateType]) || transactionTemplateListStatesInvalid.value[templateType]) {
} updateTransactionTemplateListInvalidState(templateType, false);
}
resolve(data.result); resolve(data.result);
});
}).catch(error => { }).catch(error => {
logger.error('failed to save templates display order', error); logger.error('failed to save templates display order', error);