🎨 Remove extra returns

This commit is contained in:
Kevin Sawicki 2016-11-03 09:51:01 -07:00
parent 9f18a6e65c
commit 8e203592e2

View file

@ -113,9 +113,12 @@ const asyncWebFrameMethods = function (requestId, method, callback, ...args) {
return new Promise((resolve, reject) => {
this.send('ELECTRON_INTERNAL_RENDERER_ASYNC_WEB_FRAME_METHOD', requestId, method, args)
ipcMain.once(`ELECTRON_INTERNAL_BROWSER_ASYNC_WEB_FRAME_RESPONSE_${requestId}`, function (event, error, result) {
if (callback && !error) callback(result)
if (error) return reject(error)
return resolve(result)
if (error == null) {
if (callback != null) callback(result)
resolve(result)
} else {
reject(error)
}
})
})
}