diff --git a/src/interface/web/app/page.tsx b/src/interface/web/app/page.tsx index a20e09c15..e6627c285 100644 --- a/src/interface/web/app/page.tsx +++ b/src/interface/web/app/page.tsx @@ -22,6 +22,7 @@ import { getIconFromIconName } from "@/app/common/iconUtils"; import { AgentData } from "@/app/agents/page"; import { createNewConversation } from "./common/chatFunctions"; import { useIsMobileWidth } from "./common/utils"; +import { useSearchParams } from "next/navigation"; interface ChatBodyDataProps { chatOptionsData: ChatOptions | null; @@ -51,6 +52,14 @@ function ChatBodyData(props: ChatBodyDataProps) { const [agentIcons, setAgentIcons] = useState([]); const [agents, setAgents] = useState([]); const [showLoginPrompt, setShowLoginPrompt] = useState(false); + const searchParams = useSearchParams(); + const queryParam = searchParams.get("q"); + + useEffect(() => { + if (queryParam) { + setMessage(decodeURIComponent(queryParam)); + } + }, [queryParam]); const onConversationIdChange = props.onConversationIdChange;