From 40c420f8451ba08cba595a7d33ebb2dc5eaca80b Mon Sep 17 00:00:00 2001 From: Weves Date: Mon, 4 Mar 2024 20:56:20 -0800 Subject: [PATCH] Fix disapearing chat sessions --- web/src/app/chat/sessionSidebar/ChatSidebar.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/src/app/chat/sessionSidebar/ChatSidebar.tsx b/web/src/app/chat/sessionSidebar/ChatSidebar.tsx index a774e30e8..19f6eeacc 100644 --- a/web/src/app/chat/sessionSidebar/ChatSidebar.tsx +++ b/web/src/app/chat/sessionSidebar/ChatSidebar.tsx @@ -69,6 +69,12 @@ export const ChatSidebar = ({ const currentChatId = currentChatSession?.id; + // prevent the NextJS Router cache from causing the chat sidebar to not + // update / show an outdated list of chats + useEffect(() => { + router.refresh(); + }, [currentChatId]); + return (