mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 17:24:26 +08:00
code refactor
This commit is contained in:
+2
-4
@@ -157,13 +157,11 @@ export function getCategorizedAccountsWithVisibleCount(categorizedAccounts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (account.type === accountConstants.allAccountTypes.MultiSubAccounts && account.subAccounts) {
|
if (account.type === accountConstants.allAccountTypes.MultiSubAccounts && account.subAccounts) {
|
||||||
const subAccounts = [];
|
|
||||||
let visibleSubAccountCount = 0;
|
let visibleSubAccountCount = 0;
|
||||||
let firstVisibleSubAccountIndex = -1;
|
let firstVisibleSubAccountIndex = -1;
|
||||||
|
|
||||||
for (let k = 0; k < account.subAccounts.length; k++) {
|
for (let k = 0; k < account.subAccounts.length; k++) {
|
||||||
const subAccount = account.subAccounts[k];
|
const subAccount = account.subAccounts[k];
|
||||||
subAccounts.push(subAccount);
|
|
||||||
|
|
||||||
if (!subAccount.hidden) {
|
if (!subAccount.hidden) {
|
||||||
visibleSubAccountCount++;
|
visibleSubAccountCount++;
|
||||||
@@ -174,8 +172,8 @@ export function getCategorizedAccountsWithVisibleCount(categorizedAccounts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subAccounts.length > 0) {
|
if (account.subAccounts.length > 0) {
|
||||||
allSubAccounts[account.id] = subAccounts;
|
allSubAccounts[account.id] = account.subAccounts;
|
||||||
allVisibleSubAccountCounts[account.id] = visibleSubAccountCount;
|
allVisibleSubAccountCounts[account.id] = visibleSubAccountCount;
|
||||||
allFirstVisibleSubAccountIndexes[account.id] = firstVisibleSubAccountIndex;
|
allFirstVisibleSubAccountIndexes[account.id] = firstVisibleSubAccountIndex;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user