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
This commit is contained in:
Daniel
2023-02-05 18:44:05 +03:30
committed by GitHub
parent 70ae857132
commit 144b4cdb49
+7 -3
View File
@@ -46,9 +46,13 @@ const filterManga = (
query: NullAndUndefined<string>, query: NullAndUndefined<string>,
unread: NullAndUndefined<boolean>, unread: NullAndUndefined<boolean>,
downloaded: NullAndUndefined<boolean>, downloaded: NullAndUndefined<boolean>,
): IMangaCard[] => manga.filter((m) => downloadedFilter(downloaded, m) ): IMangaCard[] => manga.filter((m) => {
&& unreadFilter(unread, m) if (query) {
&& queryFilter(query, m)); return queryFilter(query, m);
}
return downloadedFilter(downloaded, m) && unreadFilter(unread, m);
});
const sortByUnread = (a: IMangaCard, b: IMangaCard): number => const sortByUnread = (a: IMangaCard, b: IMangaCard): number =>
// eslint-disable-next-line implicit-arrow-linebreak // eslint-disable-next-line implicit-arrow-linebreak