Skip to content

Commit 8830a9e

Browse files
committed
fix
1 parent c72c0c6 commit 8830a9e

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

packages/web/src/pages/ChatPage.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)