mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-11-13 15:09:20 +01:00
feat: add UI toast notification for missing Firefox browser
This commit is contained in:
12
preload.js
12
preload.js
@@ -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);
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user