From 705ae464adab10a69373642bcd508aff7ada9779 Mon Sep 17 00:00:00 2001 From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com> Date: Fri, 29 Aug 2025 10:23:15 +0530 Subject: [PATCH] feat(chat-hook): load chat based on id after reload --- src/lib/hooks/useChat.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/hooks/useChat.tsx b/src/lib/hooks/useChat.tsx index 573ac6b..d71621d 100644 --- a/src/lib/hooks/useChat.tsx +++ b/src/lib/hooks/useChat.tsx @@ -430,6 +430,10 @@ export const ChatProvider = ({ setLoading(true); setMessageAppeared(false); + if (messages.length <= 1) { + window.history.replaceState(null, '', `/c/${chatId}`); + } + let sources: Document[] | undefined = undefined; let recievedMessage = ''; let added = false;