refactor: merge ipcMainUtils.handle / handleSync (#17062)

This commit is contained in:
Milan Burda 2019-02-27 00:48:26 +01:00 committed by Samuel Attard
parent 848d16525f
commit 5a99ea4c46
5 changed files with 13 additions and 17 deletions

View file

@ -479,19 +479,19 @@ ipcMainInternal.on('ELECTRON_BROWSER_WINDOW_CLOSE', function (event) {
event.returnValue = null
})
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_INIT', function (event, options) {
ipcMainUtils.handle('ELECTRON_CRASH_REPORTER_INIT', function (event, options) {
return crashReporterInit(options)
})
ipcMainUtils.handleSync('ELECTRON_BROWSER_GET_LAST_WEB_PREFERENCES', function (event) {
ipcMainUtils.handle('ELECTRON_BROWSER_GET_LAST_WEB_PREFERENCES', function (event) {
return event.sender.getLastWebPreferences()
})
ipcMainUtils.handleSync('ELECTRON_BROWSER_CLIPBOARD_READ_FIND_TEXT', function (event) {
ipcMainUtils.handle('ELECTRON_BROWSER_CLIPBOARD_READ_FIND_TEXT', function (event) {
return electron.clipboard.readFindText()
})
ipcMainUtils.handleSync('ELECTRON_BROWSER_CLIPBOARD_WRITE_FIND_TEXT', function (event, text) {
ipcMainUtils.handle('ELECTRON_BROWSER_CLIPBOARD_WRITE_FIND_TEXT', function (event, text) {
return electron.clipboard.writeFindText(text)
})