Skip to content

Commit 2ab760c

Browse files
authored
fix chat refresh problem (agentscope-ai#1373)
1 parent fde3c3c commit 2ab760c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

console/src/pages/Chat/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export default function ChatPage() {
143143
const currentChatId = chatIdRef.current;
144144

145145
if (
146+
isChatActiveRef.current &&
146147
sessionId &&
147148
sessionId !== lastSessionIdRef.current &&
148149
sessionId !== currentChatId
@@ -158,7 +159,7 @@ export default function ChatPage() {
158159
const createSessionWrapped = useCallback(async (session: any) => {
159160
const result = await sessionApi.createSession(session);
160161
const newSessionId = result[0]?.id;
161-
if (newSessionId) {
162+
if (isChatActiveRef.current && newSessionId) {
162163
lastSessionIdRef.current = newSessionId;
163164
navigateRef.current(`/chat/${newSessionId}`, { replace: true });
164165
}

0 commit comments

Comments
 (0)