fix(zone.js): handle new api of electron 4 (#31669)
Close #31668 PR Close #31669
This commit is contained in:
parent
7f7033bbd7
commit
a445826dad
|
@ -11,7 +11,7 @@ Zone.__load_patch('electron', (global: any, Zone: ZoneType, api: _ZonePrivate) =
|
|||
return delegate && delegate.apply(self, api.bindArguments(args, source));
|
||||
});
|
||||
}
|
||||
const {desktopCapturer, shell, CallbacksRegistry} = require('electron');
|
||||
const {desktopCapturer, shell, CallbacksRegistry, ipcRenderer} = require('electron');
|
||||
// patch api in renderer process directly
|
||||
// desktopCapturer
|
||||
if (desktopCapturer) {
|
||||
|
@ -24,6 +24,9 @@ Zone.__load_patch('electron', (global: any, Zone: ZoneType, api: _ZonePrivate) =
|
|||
|
||||
// patch api in main process through CallbackRegistry
|
||||
if (!CallbacksRegistry) {
|
||||
if (ipcRenderer) {
|
||||
patchArguments(ipcRenderer, 'on', 'ipcRenderer.on');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue