update reviewed items
This commit is contained in:
parent
98df153750
commit
7593bec687
2 changed files with 6 additions and 11 deletions
|
@ -30,7 +30,6 @@ ipcMain.on(electronSources, (event, captureWindow, captureScreen, thumbnailSize,
|
||||||
// reference from requestsQueue to make the module not send the result to it.
|
// reference from requestsQueue to make the module not send the result to it.
|
||||||
event.sender.once('destroyed', () => {
|
event.sender.once('destroyed', () => {
|
||||||
request.webContents = null
|
request.webContents = null
|
||||||
return
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -48,19 +47,15 @@ desktopCapturer.emit = (event, name, sources) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (handledWebContents != null) {
|
if (handledWebContents) {
|
||||||
handledWebContents.send(capturerResult(handledRequest.id), result)
|
handledWebContents.send(capturerResult(handledRequest.id), result)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the queue to see whether there is other same request. If has, handle
|
// Check the queue to see whether there is another identical request & handle
|
||||||
// it for reducing redunplicated `desktopCaptuer.startHandling` calls.
|
|
||||||
|
|
||||||
requestsQueue.forEach(request => {
|
requestsQueue.forEach(request => {
|
||||||
const webContents = request.webContents
|
const webContents = request.webContents
|
||||||
if (deepEqual(handledRequest.options, request.options)) {
|
if (deepEqual(handledRequest.options, request.options)) {
|
||||||
if (webContents != null) {
|
if (webContents) webContents.send(capturerResult(request.id), result)
|
||||||
webContents.send(capturerResult(request.id), result)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
unhandledRequestsQueue.push(request)
|
unhandledRequestsQueue.push(request)
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,10 @@ const incrementId = () => {
|
||||||
return currentId
|
return currentId
|
||||||
}
|
}
|
||||||
|
|
||||||
// |options.type| can not be empty and has to include 'window' or 'screen'.
|
// |options.types| can't be empty and must be an array
|
||||||
function isValid (options) {
|
function isValid (options) {
|
||||||
const types = (options != null) ? options.types : undefined
|
const types = options ? options.types : undefined
|
||||||
return (types != null) && Array.isArray(options.types)
|
return Array.isArray(types)
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.getSources = function (options, callback) {
|
exports.getSources = function (options, callback) {
|
||||||
|
|
Loading…
Reference in a new issue