fix the filter dropdown menu not display the selected items after selecting multiple hidden transaction categories or accounts

This commit is contained in:
MaysWind
2025-12-14 00:43:38 +08:00
parent b2fab42170
commit a12038e40c
4 changed files with 27 additions and 9 deletions
@@ -270,6 +270,20 @@ export function useTransactionListPageBase() {
return true;
});
function hasSubCategoryInQuery(category: TransactionCategory): boolean {
if (!category.subCategories || !category.subCategories.length) {
return false;
}
for (const subCategory of category.subCategories) {
if (queryAllFilterCategoryIds.value[subCategory.id]) {
return true;
}
}
return false;
}
function formatAmount(amount: number, hideAmount: boolean, currencyCode: string): string {
if (hideAmount) {
return formatAmountToLocalizedNumeralsWithCurrency(DISPLAY_HIDDEN_AMOUNT, currencyCode);
@@ -395,6 +409,7 @@ export function useTransactionListPageBase() {
currentMonthTransactionData,
canAddTransaction,
// functions
hasSubCategoryInQuery,
getDisplayTime,
getDisplayLongDate,
getDisplayLongYearMonth,