mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-22 09:15:33 +03:00
Fix filter logic
This commit is contained in:
parent
6685549d11
commit
5208df4a28
1 changed files with 5 additions and 3 deletions
|
@ -13,8 +13,10 @@ export function filteredItem(item, filterContext, currentAccountID) {
|
|||
return new Date(filter.expiresAt) > new Date();
|
||||
});
|
||||
const isHidden = appliedFilters.some((f) => f.filter.filterAction === 'hide');
|
||||
console.log({ isHidden, filtered, appliedFilters });
|
||||
if (!isHidden) {
|
||||
console.log({ isHidden, filtered, appliedFilters, item });
|
||||
if (isHidden) return false;
|
||||
const isWarn = appliedFilters.some((f) => f.filter.filterAction === 'warn');
|
||||
if (isWarn) {
|
||||
const filterTitles = appliedFilters.map((f) => f.filter.title);
|
||||
item._filtered = {
|
||||
titles: filterTitles,
|
||||
|
@ -22,7 +24,7 @@ export function filteredItem(item, filterContext, currentAccountID) {
|
|||
};
|
||||
item._test = { test: 'test' };
|
||||
}
|
||||
return !isHidden;
|
||||
return isWarn;
|
||||
}
|
||||
export function filteredItems(items, filterContext) {
|
||||
if (!items?.length) return [];
|
||||
|
|
Loading…
Reference in a new issue