mirror of
https://github.com/aljazceru/goose.git
synced 2026-01-03 14:34:26 +01:00
fix: use resumed session id in chat view (#1485)
This commit is contained in:
@@ -39,13 +39,12 @@ export default function ChatView({
|
||||
const [sessionId] = useState(() => {
|
||||
// If resuming a session, use that session ID
|
||||
if (resumedSession?.session_id) {
|
||||
// Store the resumed session ID in sessionStorage
|
||||
window.sessionStorage.setItem('goose-session-id', resumedSession.session_id);
|
||||
return resumedSession.session_id;
|
||||
}
|
||||
|
||||
const existingId = window.sessionStorage.getItem('goose-session-id');
|
||||
if (existingId) {
|
||||
return existingId;
|
||||
}
|
||||
// For a new chat, generate a new session ID
|
||||
const newId = generateSessionId();
|
||||
window.sessionStorage.setItem('goose-session-id', newId);
|
||||
return newId;
|
||||
@@ -67,7 +66,7 @@ export default function ChatView({
|
||||
|
||||
return {
|
||||
id: Date.now(),
|
||||
title: resumedSession.description || `Chat ${resumedSession.session_id}`,
|
||||
title: resumedSession.metadata?.description || `ID: ${resumedSession.session_id}`,
|
||||
messages: convertedMessages,
|
||||
};
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user