Skip to content

Commit 7b5af6e

Browse files
enowdevenowdev
authored andcommitted
fix(chat): keep project state aligned on session switch
1 parent e051aae commit 7b5af6e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/sidebar/SessionList.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ export const SessionList: React.FC = () => {
5858
setDeleteTarget(sessionId);
5959
};
6060

61+
const handleSelectSession = (session: Session) => {
62+
setActiveProjectId(session.projectId);
63+
setActiveSessionId(session.id);
64+
};
65+
6166
const confirmDeleteSession = async () => {
6267
if (!deleteTarget) return;
6368
const sessionId = deleteTarget;
@@ -137,7 +142,7 @@ export const SessionList: React.FC = () => {
137142
? 'bg-[var(--hover-bg-strong)] text-[var(--text)]'
138143
: 'text-[var(--text-subtle)] hover:bg-[var(--hover-bg)] hover:text-[var(--text-muted)]'
139144
)}
140-
onClick={() => setActiveSessionId(session.id)}
145+
onClick={() => handleSelectSession(session)}
141146
>
142147
<ChatCircleText
143148
size={15}

0 commit comments

Comments
 (0)