mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
fix(copilot): record current session mode before switching away
Old sessions (created before the mode fix) didn't have a recorded mode, so switching away and back would lose the mode. Now we record the current mode for the departing session before switching.
This commit is contained in:
@@ -355,6 +355,12 @@ export function useCopilotPage() {
|
||||
}
|
||||
|
||||
function handleSelectSession(id: string) {
|
||||
// Record current session's mode before switching away so it's
|
||||
// preserved when the user switches back — covers sessions created
|
||||
// before the per-session mode fix was deployed.
|
||||
if (sessionId) {
|
||||
recordSessionMode(sessionId);
|
||||
}
|
||||
setSessionId(id);
|
||||
restoreSessionMode(id);
|
||||
if (isMobile) setDrawerOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user