Skip to content

Commit

Permalink
Merge pull request #106 from mbret/develop
Browse files Browse the repository at this point in the history
fix: fixed not interested books showing in library
  • Loading branch information
mbret authored Mar 16, 2024
2 parents e9434ba + 0cb3454 commit 9233b76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/web/src/library/LibraryBooksScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ export const LibraryBooksScreen = () => {
const localSettings = useLocalSettings()
const library = useSignalValue(libraryStateSignal)
let numberOfFiltersApplied = 0

if ((library.tags.length || 0) > 0) numberOfFiltersApplied++
if ((library.readingStates.length || 0) > 0) numberOfFiltersApplied++
if (library.downloadState !== undefined) numberOfFiltersApplied++
if (library.isNotInterested === "only") numberOfFiltersApplied++

const books = useBooks()
const { t } = useTranslation()

Expand All @@ -58,7 +61,9 @@ export const LibraryBooksScreen = () => {
<Button
fullWidth
variant="outlined"
onClick={() => isUploadBookDrawerOpenedStateSignal.setValue(true)}
onClick={() => {
isUploadBookDrawerOpenedStateSignal.setValue(true)
}}
>
{t(`library.button.book.add.title`)}
</Button>
Expand Down
3 changes: 2 additions & 1 deletion packages/web/src/library/useBooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const useBooks = () => {
return false
}

if (library.isNotInterested === "hide" && book.isNotInterested) return false
if (library.isNotInterested !== "only" && book.isNotInterested) return false

if (library.isNotInterested === "only" && !book.isNotInterested)
return false

Expand Down

0 comments on commit 9233b76

Please sign in to comment.