@@ -10,8 +10,8 @@ ipc.callMain = (channel, data) => new Promise((resolve, reject) => {
1010 const { sendChannel, dataChannel, errorChannel} = util . getResponseChannels ( channel ) ;
1111
1212 const cleanup = ( ) => {
13- ipc . off ( dataChannel , onData ) ;
14- ipc . off ( errorChannel , onError ) ;
13+ ipcRenderer . off ( dataChannel , onData ) ;
14+ ipcRenderer . off ( errorChannel , onError ) ;
1515 } ;
1616
1717 const onData = ( _event , result ) => {
@@ -24,16 +24,16 @@ ipc.callMain = (channel, data) => new Promise((resolve, reject) => {
2424 reject ( deserializeError ( error ) ) ;
2525 } ;
2626
27- ipc . once ( dataChannel , onData ) ;
28- ipc . once ( errorChannel , onError ) ;
27+ ipcRenderer . once ( dataChannel , onData ) ;
28+ ipcRenderer . once ( errorChannel , onError ) ;
2929
3030 const completeData = {
3131 dataChannel,
3232 errorChannel,
3333 userData : data
3434 } ;
3535
36- ipc . send ( sendChannel , completeData ) ;
36+ ipcRenderer . send ( sendChannel , completeData ) ;
3737} ) ;
3838
3939ipc . answerMain = ( channel , callback ) => {
@@ -43,16 +43,16 @@ ipc.answerMain = (channel, callback) => {
4343 const { dataChannel, errorChannel, userData} = data ;
4444
4545 try {
46- ipc . send ( dataChannel , await callback ( userData ) ) ;
46+ ipcRenderer . send ( dataChannel , await callback ( userData ) ) ;
4747 } catch ( error ) {
48- ipc . send ( errorChannel , serializeError ( error ) ) ;
48+ ipcRenderer . send ( errorChannel , serializeError ( error ) ) ;
4949 }
5050 } ;
5151
52- ipc . on ( sendChannel , listener ) ;
52+ ipcRenderer . on ( sendChannel , listener ) ;
5353
5454 return ( ) => {
55- ipc . off ( sendChannel , listener ) ;
55+ ipcRenderer . off ( sendChannel , listener ) ;
5656 } ;
5757} ;
5858
0 commit comments