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

@ -170,7 +170,7 @@ ipcMainInternal.on('CHROME_RUNTIME_CONNECT', function (event, extensionId, conne
page.webContents._sendInternalToAll(`CHROME_RUNTIME_ONCONNECT_${extensionId}`, event.sender.id, portId, connectInfo)
})
ipcMainUtils.handleSync('CHROME_EXTENSION_MANIFEST', function (event, extensionId) {
ipcMainUtils.handle('CHROME_EXTENSION_MANIFEST', function (event, extensionId) {
const manifest = manifestMap[extensionId]
if (!manifest) {
throw new Error(`Invalid extensionId: ${extensionId}`)
@ -232,7 +232,7 @@ const getMessagesPath = (extensionId) => {
}
}
ipcMainUtils.handleSync('CHROME_GET_MESSAGES', function (event, extensionId) {
ipcMainUtils.handle('CHROME_GET_MESSAGES', function (event, extensionId) {
const messagesPath = getMessagesPath(extensionId)
return fs.readFileSync(messagesPath)
})