From 0e812a247969ee6861b98b7f396ca5ea925df538 Mon Sep 17 00:00:00 2001 From: Fredrik Johansson Date: Mon, 29 Jun 2026 10:55:00 +0200 Subject: [PATCH] fix: clear file progress on completion in daemon mode file_complete in daemon mode carries transfer_id but no offer field. The old condition required msg.offer, so the progress/cancel row was never removed. Now clears using transfer_id first, offer.xid as fallback. Co-Authored-By: Claude Sonnet 4.6 --- web/src/store/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/store/index.ts b/web/src/store/index.ts index 571bfd2..66b185f 100644 --- a/web/src/store/index.ts +++ b/web/src/store/index.ts @@ -347,10 +347,13 @@ export const useWaste = create((set, get) => ({ break } case 'file_complete': { - if (msg.path && msg.offer?.name) { - // clear progress entry - const xid = msg.offer.xid + // Always clear progress — transfer_id is the xid in daemon mode; offer.xid in browser mode. + const xid = msg.transfer_id ?? msg.offer?.xid + if (xid) { set(s => { const fp = { ...s.fileProgress }; delete fp[xid]; return { fileProgress: fp } }) + } + // Browser mode: trigger download via anchor click. + if (msg.path && msg.offer?.name) { const a = document.createElement('a') a.href = msg.path a.download = msg.offer.name