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 16:14:05 +01:00
committed by GitHub
parent 70ae857132
commit 144b4cdb49

View File

@@ -46,9 +46,13 @@ const filterManga = (
query: NullAndUndefined<string>,
unread: NullAndUndefined<boolean>,
downloaded: NullAndUndefined<boolean>,
): 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