🎨 Remove extra returns
This commit is contained in:
parent
9f18a6e65c
commit
8e203592e2
1 changed files with 6 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue