Skip to content

Commit 382158f

Browse files
Santoshsteipete
authored andcommitted
fix(ui): auto-refresh sessions list after deletion
Remove dead loadSessions call from deleteSession controller that was silently failing due to sessionsLoading guard. The refresh now happens explicitly in the UI layer after successful deletion. - src/ui/controllers/sessions.ts: remove internal loadSessions call - src/ui/app-render.ts: add async onDelete handler with explicit refresh
1 parent 66fc12a commit 382158f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎ui/src/ui/app-render.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ export function renderApp(state: AppViewState) {
301301
},
302302
onRefresh: () => loadSessions(state),
303303
onPatch: (key, patch) => patchSession(state, key, patch),
304-
onDelete: (key) => deleteSession(state, key),
304+
onDelete: async (key) => {
305+
await deleteSession(state, key);
306+
await loadSessions(state);
307+
},
305308
})
306309
: nothing
307310
}

‎ui/src/ui/controllers/sessions.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export async function deleteSession(state: SessionsState, key: string) {
108108
state.sessionsError = null;
109109
try {
110110
await state.client.request("sessions.delete", { key, deleteTranscript: true });
111-
await loadSessions(state);
112111
} catch (err) {
113112
state.sessionsError = String(err);
114113
} finally {

0 commit comments

Comments
 (0)