Fix stale deleted sessions in sidebar (#1203)

Co-authored-by: ghreprimand <203024559+ghreprimand@users.noreply.github.com>
This commit is contained in:
ghreprimand
2026-06-02 09:52:22 -05:00
committed by GitHub
parent 87babb58d5
commit e72b9a8a95
3 changed files with 70 additions and 8 deletions
+1 -4
View File
@@ -3130,10 +3130,7 @@ function initializeEventListeners() {
const idx = sessions.findIndex(s => s.id === currentId);
const nextSession = sessions.filter(s => !s.archived && s.id !== currentId)[Math.max(0, idx)] ||
sessions.find(s => !s.archived && s.id !== currentId);
const res = await fetch(`${API_BASE}/api/session/${currentId}/archive`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
});
const res = await fetch(`${API_BASE}/api/session/${currentId}`, { method: 'DELETE' });
if (res.ok) {
await sessionModule.loadSessions();
if (nextSession) {