support selecting all visible in account / category / tag filter dialog / page

This commit is contained in:
MaysWind
2025-10-29 00:52:03 +08:00
parent 48a06c6570
commit 274fb8b4e2
24 changed files with 146 additions and 0 deletions
+20
View File
@@ -249,6 +249,26 @@ export function selectAccountOrSubAccounts(filterAccountIds: Record<string, bool
}
}
export function selectAllVisible(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>): void {
for (const accountId of keys(filterAccountIds)) {
const account = allAccountsMap[accountId];
if (account) {
if (account.hidden) {
continue;
}
if (account.parentId && allAccountsMap[account.parentId] && allAccountsMap[account.parentId]!.hidden) {
continue;
}
if (account.type === AccountType.SingleAccount.type) {
filterAccountIds[account.id] = false;
}
}
}
}
export function selectAll(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>, skipHiddenAccount: boolean): void {
for (const accountId of keys(filterAccountIds)) {
const account = allAccountsMap[accountId];