From d4ce2a3ed6be90d9bb77d162b352d9020d27d1af Mon Sep 17 00:00:00 2001 From: ajnart Date: Tue, 17 May 2022 01:52:43 +0200 Subject: [PATCH] :label: Update types for the SearchBar --- src/components/SearchBar/SearchBar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/SearchBar/SearchBar.tsx b/src/components/SearchBar/SearchBar.tsx index b9151e8f4..7018dc18f 100644 --- a/src/components/SearchBar/SearchBar.tsx +++ b/src/components/SearchBar/SearchBar.tsx @@ -1,6 +1,6 @@ import { TextInput, Kbd, createStyles, useMantineTheme, Text, Popover } from '@mantine/core'; import { useForm, useHotkeys } from '@mantine/hooks'; -import { MutableRefObject, useRef, useState } from 'react'; +import { useRef, useState } from 'react'; import { Search, BrandYoutube, Download } from 'tabler-icons-react'; import { useConfig } from '../../tools/state'; @@ -20,7 +20,7 @@ export default function SearchBar(props: any) { const [icon, setIcon] = useState(); const queryUrl = config.settings.searchUrl || 'https://www.google.com/search?q='; const textInput = useRef(); - useHotkeys([['ctrl+K', () => textInput.current.focus()]]); + useHotkeys([['ctrl+K', () => textInput.current && textInput.current.focus()]]); const { classes, cx } = useStyles(); const theme = useMantineTheme();