From 144b4cdb49c7415047385e789babb154c84aafb2 Mon Sep 17 00:00:00 2001 From: Daniel <50052685+schroda@users.noreply.github.com> Date: Sun, 5 Feb 2023 16:14:05 +0100 Subject: [PATCH] Ignore filters while searching (#226) Search was only searching in the filtered manga, thus, it was not possible to find a manga that was not included in the set filters --- src/components/library/LibraryMangaGrid.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/library/LibraryMangaGrid.tsx b/src/components/library/LibraryMangaGrid.tsx index e0a7a67e..564af443 100644 --- a/src/components/library/LibraryMangaGrid.tsx +++ b/src/components/library/LibraryMangaGrid.tsx @@ -46,9 +46,13 @@ const filterManga = ( query: NullAndUndefined, unread: NullAndUndefined, downloaded: NullAndUndefined, -): IMangaCard[] => manga.filter((m) => downloadedFilter(downloaded, m) - && unreadFilter(unread, m) - && queryFilter(query, m)); +): IMangaCard[] => manga.filter((m) => { + if (query) { + return queryFilter(query, m); + } + + return downloadedFilter(downloaded, m) && unreadFilter(unread, m); +}); const sortByUnread = (a: IMangaCard, b: IMangaCard): number => // eslint-disable-next-line implicit-arrow-linebreak