desktop v0.1.20 + web: notify on download complete (was silent) (batch135)

Suppressing the save dialog made downloads completely silent — "nothing happened" even though
the file saved to Downloads. Now on download 'done': (1) tell the web UI → branded toast
"Saved X to your Downloads folder" when the window is focused; (2) native OS notification
(click → reveal in Explorer) when the app is minimized/in the tray, so it's never double-noticed;
(3) a failure notice. preload exposes onDownloadDone; home.html shows the toast.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 16:03:24 +05:30
parent 30eaf37773
commit f2b965bd3d
4 changed files with 25 additions and 2 deletions
+1
View File
@@ -43,5 +43,6 @@ contextBridge.exposeInMainWorld('bizConnectNative', Object.freeze({
// #3: subscribe to auto-update lifecycle events so the UI can show download progress + "ready".
// cb receives {phase:'checking'|'available'|'downloading'|'ready'|'current'|'error', percent?, version?}.
onUpdateEvent: (cb) => { try { ipcRenderer.on('update-event', (_e, data) => { try { cb(data); } catch (_) {} }); } catch (_) {} },
onDownloadDone: (cb) => { try { ipcRenderer.on('download-done', (_e, data) => { try { cb(data); } catch (_) {} }); } catch (_) {} }, // desktop: a file finished downloading to the Downloads folder → show a toast
restartToUpdate: () => ipcRenderer.invoke('restart-to-update'),
}));