code refactor

This commit is contained in:
MaysWind
2025-04-03 23:50:14 +08:00
parent b059055a93
commit 2c9bb12da9
4 changed files with 22 additions and 24 deletions
-20
View File
@@ -338,23 +338,3 @@ export function isAccountOrSubAccountsHasButNotAllChecked(account: Account, filt
return checkedCount > 0 && checkedCount < account.subAccounts.length;
}
export function setAccountSuitableIcon(account: Account, oldCategory: number, newCategory: number): void {
const allCategories = AccountCategory.values();
for (let i = 0; i < allCategories.length; i++) {
if (allCategories[i].type === oldCategory) {
if (account.icon !== allCategories[i].defaultAccountIconId) {
return;
} else {
break;
}
}
}
for (let i = 0; i < allCategories.length; i++) {
if (allCategories[i].type === newCategory) {
account.icon = allCategories[i].defaultAccountIconId;
}
}
}