Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit a18d166

Browse files
committed
fix: disable search if there are no library created yet
1 parent cc9e743 commit a18d166

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/headerSearch.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export function SearchControl() {
2626

2727
const router = useRouter();
2828
const mangaQuery = trpc.manga.query.useQuery();
29+
const libraryQuery = trpc.library.query.useQuery();
2930
const { classes, cx } = useStyles();
3031

3132
useEffect(() => {
@@ -69,6 +70,7 @@ export function SearchControl() {
6970
searchIcon={<IconSearch size={18} />}
7071
highlightQuery
7172
limit={5}
73+
disabled={libraryQuery.isLoading || !libraryQuery.data}
7274
searchPlaceholder="Search..."
7375
shortcut="ctrl + p"
7476
nothingFoundMessage="Nothing found..."

0 commit comments

Comments
 (0)