Skip to content

Commit

Permalink
fix: disable search if there are no library created yet
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Oct 29, 2022
1 parent cc9e743 commit a18d166
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/headerSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function SearchControl() {

const router = useRouter();
const mangaQuery = trpc.manga.query.useQuery();
const libraryQuery = trpc.library.query.useQuery();
const { classes, cx } = useStyles();

useEffect(() => {
Expand Down Expand Up @@ -69,6 +70,7 @@ export function SearchControl() {
searchIcon={<IconSearch size={18} />}
highlightQuery
limit={5}
disabled={libraryQuery.isLoading || !libraryQuery.data}
searchPlaceholder="Search..."
shortcut="ctrl + p"
nothingFoundMessage="Nothing found..."
Expand Down

0 comments on commit a18d166

Please sign in to comment.