update reviewed items

This commit is contained in:
Shelley Vohr 2017-10-24 19:36:06 -04:00
parent 98df153750
commit 7593bec687
No known key found for this signature in database
GPG key ID: F13993A75599653C
2 changed files with 6 additions and 11 deletions

View file

@ -30,7 +30,6 @@ ipcMain.on(electronSources, (event, captureWindow, captureScreen, thumbnailSize,
// reference from requestsQueue to make the module not send the result to it.
event.sender.once('destroyed', () => {
request.webContents = null
return
})
})
@ -48,19 +47,15 @@ desktopCapturer.emit = (event, name, sources) => {
}
})
if (handledWebContents != null) {
if (handledWebContents) {
handledWebContents.send(capturerResult(handledRequest.id), result)
}
// Check the queue to see whether there is other same request. If has, handle
// it for reducing redunplicated `desktopCaptuer.startHandling` calls.
// Check the queue to see whether there is another identical request & handle
requestsQueue.forEach(request => {
const webContents = request.webContents
if (deepEqual(handledRequest.options, request.options)) {
if (webContents != null) {
webContents.send(capturerResult(request.id), result)
}
if (webContents) webContents.send(capturerResult(request.id), result)
} else {
unhandledRequestsQueue.push(request)
}