feat: add UI toast notification for missing Firefox browser

This commit is contained in:
MasterAcnolo
2026-10-27 20:19:39 +01:00
parent 7c5ccb1527
commit dc898e1235
5 changed files with 89 additions and 1 deletions

View File

@@ -159,6 +159,18 @@ contextBridge.exposeInMainWorld("electronAPI", {
ipcRenderer.on("update-downloaded", (_, info) => callback(info)),
openReleasePage: () => ipcRenderer.send("open-release-page"),
/**
* Subscribes to toast notifications emitted by the main process.
*
* @param {Function} callback - Function executed with toast data.
* @returns {Function} Removes the listener.
*/
onToast: (callback) => {
const listener = (_, toast) => callback(toast);
ipcRenderer.on("show-toast", listener);
return () => ipcRenderer.removeListener("show-toast", listener);
},
});
/**