@@ -62,12 +62,15 @@ function SearchChat({
6262
6363 const source = currentAssistant ?. _source ;
6464
65- const customInitialState = useMemo ( ( ) => ( {
66- ...initialAppState ,
67- isDeepThinkActive : source ?. type === "deep_think" ,
68- isSearchActive : source ?. datasource ?. enabled_by_default === true ,
69- isMCPActive : source ?. mcp_servers ?. enabled_by_default === true ,
70- } ) , [ source ] ) ;
65+ const customInitialState = useMemo (
66+ ( ) => ( {
67+ ...initialAppState ,
68+ isDeepThinkActive : source ?. type === "deep_think" ,
69+ isSearchActive : source ?. datasource ?. enabled_by_default === true ,
70+ isMCPActive : source ?. mcp_servers ?. enabled_by_default === true ,
71+ } ) ,
72+ [ source ]
73+ ) ;
7174
7275 const [ state , dispatch ] = useReducer ( appReducer , customInitialState ) ;
7376 const {
@@ -80,9 +83,18 @@ function SearchChat({
8083 isTyping,
8184 } = state ;
8285 useEffect ( ( ) => {
83- dispatch ( { type : "SET_SEARCH_ACTIVE" , payload : customInitialState . isSearchActive } ) ;
84- dispatch ( { type : "SET_DEEP_THINK_ACTIVE" , payload : customInitialState . isDeepThinkActive } ) ;
85- dispatch ( { type : "SET_MCP_ACTIVE" , payload : customInitialState . isMCPActive } ) ;
86+ dispatch ( {
87+ type : "SET_SEARCH_ACTIVE" ,
88+ payload : customInitialState . isSearchActive ,
89+ } ) ;
90+ dispatch ( {
91+ type : "SET_DEEP_THINK_ACTIVE" ,
92+ payload : customInitialState . isDeepThinkActive ,
93+ } ) ;
94+ dispatch ( {
95+ type : "SET_MCP_ACTIVE" ,
96+ payload : customInitialState . isMCPActive ,
97+ } ) ;
8698 } , [ customInitialState ] ) ;
8799
88100 const [ isWin10 , setIsWin10 ] = useState ( false ) ;
@@ -264,13 +276,11 @@ function SearchChat({
264276 ) }
265277 style = { { opacity : blurred ? ( opacity ?? 30 ) / 100 : 1 } }
266278 >
267-
268279 < div
269280 data-tauri-drag-region = { isTauri }
270- className = { clsx (
271- "flex-1 w-full overflow-auto" ,
272- { "hidden" : ! isTransitioned }
273- ) }
281+ className = { clsx ( "flex-1 w-full overflow-auto" , {
282+ hidden : ! isTransitioned ,
283+ } ) }
274284 >
275285 < Suspense fallback = { < LoadingFallback /> } >
276286 < ChatAI
@@ -290,8 +300,9 @@ function SearchChat({
290300
291301 < div
292302 data-tauri-drag-region = { isTauri }
293- className = { `p-2 w-full flex justify-center transition-all duration-500 min-h-[82px] ${ isTransitioned ? "border-t" : "border-b"
294- } border-[#E6E6E6] dark:border-[#272626]`}
303+ className = { `p-2 w-full flex justify-center transition-all duration-500 min-h-[82px] ${
304+ isTransitioned ? "border-t" : "border-b"
305+ } border-[#E6E6E6] dark:border-[#272626]`}
295306 >
296307 < InputBox
297308 isChatMode = { isChatMode }
@@ -326,10 +337,9 @@ function SearchChat({
326337
327338 < div
328339 data-tauri-drag-region = { isTauri }
329- className = { clsx (
330- "flex-1 w-full overflow-auto" ,
331- { "hidden" : isTransitioned }
332- ) }
340+ className = { clsx ( "flex-1 w-full overflow-auto" , {
341+ hidden : isTransitioned ,
342+ } ) }
333343 >
334344 < Suspense fallback = { < LoadingFallback /> } >
335345 < Search
@@ -338,6 +348,7 @@ function SearchChat({
338348 isChatMode = { isChatMode }
339349 changeInput = { setInput }
340350 setIsPinned = { setIsPinned }
351+ changeMode = { changeMode }
341352 />
342353 </ Suspense >
343354 </ div >
0 commit comments