fix the bug that the frontend would not display any secondary transaction categories after modifying the primary transaction category

This commit is contained in:
MaysWind
2024-06-24 00:51:57 +08:00
parent 756e6cac5a
commit fb315127f9
+4
View File
@@ -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;
}