mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-03 05:59:43 +02:00
fix: actually jump into restored session on reload, not just highlight tab
handleInit is called twice on page load (loadState + SSE init). The second call cleared terminal state but skipped selectSession because activeSessionId was still set from the first call. Now reset activeSessionId before re-selecting so the terminal buffer always gets reloaded. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+11
-4
@@ -3211,10 +3211,17 @@ class ClaudemanApp {
|
||||
});
|
||||
}
|
||||
|
||||
// Restore previously active session (survives page reload), or fall back to first
|
||||
if (this.sessionOrder.length > 0 && !this.activeSessionId) {
|
||||
let restoreId = null;
|
||||
try { restoreId = localStorage.getItem('claudeman-active-session'); } catch {}
|
||||
// Restore previously active session (survives page reload + SSE reconnect)
|
||||
// Must always re-select because handleInit clears terminal state above.
|
||||
// Reset activeSessionId so selectSession doesn't early-return.
|
||||
const previousActiveId = this.activeSessionId;
|
||||
this.activeSessionId = null;
|
||||
if (this.sessionOrder.length > 0) {
|
||||
// Priority: current active > localStorage > first session
|
||||
let restoreId = previousActiveId;
|
||||
if (!restoreId || !this.sessions.has(restoreId)) {
|
||||
try { restoreId = localStorage.getItem('claudeman-active-session'); } catch {}
|
||||
}
|
||||
if (restoreId && this.sessions.has(restoreId)) {
|
||||
this.selectSession(restoreId);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user