code refactor

This commit is contained in:
MaysWind
2024-12-30 23:11:03 +08:00
parent 2560a70e5e
commit 863e0205ff
6 changed files with 21 additions and 35 deletions
+3 -5
View File
@@ -77,12 +77,10 @@ export function allTransactionCategoriesWithVisibleCount(allTransactionCategorie
|| allowCategoryTypes[CategoryType.Expense.toString()]
|| allowCategoryTypes[CategoryType.Transfer.toString()]);
for (let key in CategoryType) {
if (!Object.prototype.hasOwnProperty.call(CategoryType, key)) {
continue;
}
const allCategoryTypes = [ CategoryType.Income, CategoryType.Expense, CategoryType.Transfer ];
const categoryType = CategoryType[key];
for (let i = 0; i < allCategoryTypes.length; i++) {
const categoryType = allCategoryTypes[i];
if (!allTransactionCategories[categoryType]) {
continue;