diff --git a/frontend/src/components/UnifiedChat.tsx b/frontend/src/components/UnifiedChat.tsx index 7ee2c5ba..b08413b5 100644 --- a/frontend/src/components/UnifiedChat.tsx +++ b/frontend/src/components/UnifiedChat.tsx @@ -817,8 +817,10 @@ export function UnifiedChat() { const [isProcessingSend, setIsProcessingSend] = useState(false); const [audioError, setAudioError] = useState(null); - // Web search toggle state - const [isWebSearchEnabled, setIsWebSearchEnabled] = useState(false); + // Web search toggle state - persisted in localStorage + const [isWebSearchEnabled, setIsWebSearchEnabled] = useState(() => { + return localStorage.getItem("webSearchEnabled") === "true"; + }); // Fullscreen mode for power users - persisted in localStorage const [isFullscreen, setIsFullscreen] = useState(() => { @@ -831,6 +833,11 @@ export function UnifiedChat() { localStorage.setItem("chatFullscreen", isFullscreen.toString()); }, [isFullscreen]); + // Save web search preference to localStorage when it changes + useEffect(() => { + localStorage.setItem("webSearchEnabled", isWebSearchEnabled.toString()); + }, [isWebSearchEnabled]); + // Toggle fullscreen with animation const toggleFullscreen = useCallback(() => { setIsFullscreenAnimating(true);