fix(zone.js): handle new api of electron 4 (#31669)

Close #31668

PR Close #31669
This commit is contained in:
JiaLiPassion 2019-07-20 19:55:13 +09:00 committed by Misko Hevery
parent 7f7033bbd7
commit a445826dad
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}