Skip to content

Commit

Permalink
Fix stacking listeners and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
dacoaster committed Mar 9, 2023
1 parent 68d3128 commit f471052
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yattie",
"version": "0.5.4",
"version": "0.5.5",
"engines": {
"npm": ">=8.0.0 <9.0.0",
"node": ">=16.0.0 <17.0.0"
Expand Down
5 changes: 5 additions & 0 deletions src/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ contextBridge.exposeInMainWorld("ipc", {
return await ipcRenderer.invoke(channel, data);
},
on: (channel, func) => {
// Remove any old listeners
ipcRenderer.removeAllListeners(channel);
// Strip event as it includes `sender` and is a security risk
ipcRenderer.on(channel, (event, ...args) => func(...args));
},
clearCache: () => {
webFrame.clearCache();
},
eventNames: () => {
return ipcRenderer.eventNames();
},
});

0 comments on commit f471052

Please sign in to comment.