diff --git a/packages/frontend/src/components/layouts/search/Search.tsx b/packages/frontend/src/components/layouts/search/Search.tsx index d5485406..5b006447 100644 --- a/packages/frontend/src/components/layouts/search/Search.tsx +++ b/packages/frontend/src/components/layouts/search/Search.tsx @@ -15,6 +15,7 @@ export const Search = ({ className }: SearchProps) => { const handleSubmit = (event: FormEvent) => { event.preventDefault(); + if (!stockName) return; refetch(); }; diff --git a/packages/frontend/src/pages/stock-detail/hooks/useChart.ts b/packages/frontend/src/pages/stock-detail/hooks/useChart.ts index 7b26f1d3..b7c22836 100644 --- a/packages/frontend/src/pages/stock-detail/hooks/useChart.ts +++ b/packages/frontend/src/pages/stock-detail/hooks/useChart.ts @@ -44,7 +44,11 @@ export const useChart = ({ const containerInstance = containerRef.current; const { theme } = useContext(ThemeContext); - const graphTheme = theme === 'light' ? lightTheme : darkTheme; + const graphTheme = theme + ? theme === 'light' + ? lightTheme + : darkTheme + : lightTheme; useEffect(() => { if (!containerInstance) return;