Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions crates/ironclaw_gateway/static/js/core/sse.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,18 +390,16 @@ function connectSSE(lastEventIdOverride) {

addTrackedEventListener('approval_needed', (e) => {
const data = JSON.parse(e.data);
const hasThread = !!data.thread_id;
const forCurrentThread = !hasThread || isCurrentThread(data.thread_id);
if (data.thread_id) {
activeWorkStore.updateThread(data.thread_id, {
statusText: ActivityEntry.t('activity.waitingApproval', 'Waiting for approval'),
blockedReason: 'approval',
});
}

if (forCurrentThread) {
if (isCurrentThread(data.thread_id)) {
showApproval(data);
} else {
} else if (data.thread_id) {
// Keep thread list fresh when approval is requested in a background thread.
unreadThreads.set(data.thread_id, (unreadThreads.get(data.thread_id) || 0) + 1);
debouncedLoadThreads();
Expand Down Expand Up @@ -545,7 +543,7 @@ function connectSSE(lastEventIdOverride) {
// Plan progress checklist
addTrackedEventListener('plan_update', (e) => {
const data = JSON.parse(e.data);
if (data.thread_id && !isCurrentThread(data.thread_id)) return;
if (!isCurrentThread(data.thread_id)) return;
renderPlanChecklist(data);
});
}
Expand Down
Loading