mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
fix the filter dropdown menu not display the selected items after selecting multiple hidden transaction categories or accounts
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user