Skip to content

Commit

Permalink
fix the bug that the frontend would not display any secondary transac…
Browse files Browse the repository at this point in the history
…tion categories after modifying the primary transaction category
  • Loading branch information
mayswind committed Jun 23, 2024
1 parent 756e6ca commit fb31512
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/stores/transactionCategory.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function updateCategoryInTransactionCategoryList(state, category, oldCategory) {
if (categoryList) {
for (let i = 0; i < categoryList.length; i++) {
if (categoryList[i].id === category.id) {
if (!category.parentId || category.parentId === '0') {
category.subCategories = categoryList[i].subCategories;
}

categoryList.splice(i, 1, category);
break;
}
Expand Down

0 comments on commit fb31512

Please sign in to comment.