Skip to content

Commit

Permalink
feat: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mbret committed Feb 25, 2024
1 parent 51d0857 commit be0ba7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/web/src/books/states.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const getEnrichedBookState = ({
protectedTagIds: ReturnType<typeof useProtectedTagIds>["data"]
tags: ReturnType<typeof useTagsByIds>["data"]
normalizedLinks: ReturnType<typeof useLinks>["data"]
normalizedCollections: ReturnType<typeof useCollectionsDictionary>["data"]
normalizedCollections: Omit<ReturnType<typeof useCollectionsDictionary>["data"], "displayableName">
normalizedBooks: ReturnType<typeof useBooksDic>["data"]
}) => {
const book = getBookState({
Expand Down Expand Up @@ -206,7 +206,7 @@ export const useEnrichedBookState = (param: {
tags: ReturnType<typeof useTagsByIds>["data"]
}) => {
const { data: normalizedLinks } = useLinks()
const { data: normalizedCollections } = useCollectionsDictionary()
const { data: normalizedCollections = {} } = useCollectionsDictionary()
const { data: normalizedBooks } = useBooksDic()

return getEnrichedBookState({
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/plugins/useRemoveBookFromDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useRemoveBookFromDataSource = () => {
async (bookId: string) => {
const book = await db?.book.findOne({ selector: { _id: bookId } }).exec()
const link = await db?.link
.findOne({ selector: { _id: book?.links[0] || null } })
.findOne({ selector: { _id: book?.links[0] ?? "-1" } })
.exec()

if (!link) {
Expand Down

0 comments on commit be0ba7d

Please sign in to comment.