fix: type internal APIs that can return null properly (#29852)

This commit is contained in:
Milan Burda 2021-07-27 07:48:12 +02:00 committed by GitHub
parent 461db8f1ab
commit a545cd3790
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 12 deletions

View file

@ -67,7 +67,7 @@ ipcMainInternal.handle(IPC_MESSAGES.INSPECTOR_CONTEXT_MENU, function (event, ite
const template = isEditMenu ? getEditMenuItems() : convertToMenuTemplate(items, resolve);
const menu = Menu.buildFromTemplate(template);
const window = event.sender.getOwnerBrowserWindow();
const window = event.sender.getOwnerBrowserWindow()!;
menu.popup({ window, callback: () => resolve() });
});
@ -94,7 +94,7 @@ ipcMainUtils.handleSync(IPC_MESSAGES.INSPECTOR_CONFIRM, async function (event, m
buttons: ['OK', 'Cancel'],
cancelId: 1
};
const window = event.sender.getOwnerBrowserWindow();
const window = event.sender.getOwnerBrowserWindow()!;
const { response } = await dialog.showMessageBox(window, options);
return response === 0;
});