mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 00:46:45 +00:00
feat(electronSecurity): make on method more secure
This commit is contained in:
parent
a32281e07f
commit
c3cba4d9b3
1 changed files with 4 additions and 3 deletions
|
|
@ -12,9 +12,10 @@ const _invoke: (channel: IPCEventValue, ...args: any[]) => Promise<unknown> = (
|
|||
) => ipcRenderer.invoke(channel, ...args);
|
||||
|
||||
const ea: ElectronAPI = {
|
||||
on: (channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void) =>
|
||||
ipcRenderer.on(channel, listener),
|
||||
|
||||
on: (channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void) => {
|
||||
// NOTE: there is no proper way to unsubscribe apart from unsusbscribing all
|
||||
ipcRenderer.on(channel, listener);
|
||||
},
|
||||
// INVOKE
|
||||
// ------
|
||||
getUserDataPath: () => _invoke('GET_PATH', 'userData') as Promise<string>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue