File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -405,6 +405,11 @@ const ChatPage: React.FC = () => {
405405 }
406406 } ;
407407
408+ // Initialize forceExpandPromptList to null when the path changes
409+ useEffect ( ( ) => {
410+ setForceExpandPromptList ( null ) ;
411+ } , [ pathname , setForceExpandPromptList ] ) ;
412+
408413 return (
409414 < >
410415 < div
@@ -443,14 +448,16 @@ const ChatPage: React.FC = () => {
443448 } `}
444449 />
445450
446- < Button
447- className = "text-sm"
448- outlined
449- onClick = { ( ) => {
450- setForceExpandPromptList ( Math . random ( ) ) ;
451- } } >
452- { t ( 'chat.view_prompt_examples' ) }
453- </ Button >
451+ { ! loadingMessages && (
452+ < Button
453+ className = "text-sm"
454+ outlined
455+ onClick = { ( ) => {
456+ setForceExpandPromptList ( Math . random ( ) ) ;
457+ } } >
458+ { t ( 'chat.view_prompt_examples' ) }
459+ </ Button >
460+ ) }
454461 </ div >
455462 ) }
456463
You can’t perform that action at this time.
0 commit comments