code refactor

This commit is contained in:
MaysWind
2021-01-07 23:50:35 +08:00
parent 1b2a37e6d1
commit d10726d45e
7 changed files with 433 additions and 345 deletions
-20
View File
@@ -358,25 +358,6 @@ function getCategoryInfo(categoryId) {
return null;
}
function getPlainAccounts(allAccounts) {
const ret = [];
for (let i = 0; i < allAccounts.length; i++) {
const account = allAccounts[i];
if (account.type === accountConstants.allAccountTypes.SingleAccount) {
ret.push(account);
} else if (account.type === accountConstants.allAccountTypes.MultiSubAccounts) {
for (let j = 0; j < account.subAccounts.length; j++) {
const subAccount = account.subAccounts[j];
ret.push(subAccount);
}
}
}
return ret;
}
function getCategorizedAccounts(allAccounts) {
const ret = {};
@@ -490,7 +471,6 @@ export default {
generateRandomString,
parseUserAgent,
getCategoryInfo,
getPlainAccounts,
getCategorizedAccounts,
getAllFilteredAccountsBalance,
};