Remove deprecated API usages
This commit is contained in:
parent
785bc2986b
commit
51368952a2
4 changed files with 11 additions and 15 deletions
|
@ -1,15 +1,11 @@
|
|||
ipc = require 'ipc'
|
||||
NativeImage = require 'native-image'
|
||||
{ipcRenderer, NativeImage} = require 'electron'
|
||||
|
||||
nextId = 0
|
||||
getNextId = -> ++nextId
|
||||
|
||||
getSources = (options, callback) ->
|
||||
exports.getSources = (options, callback) ->
|
||||
id = getNextId()
|
||||
ipc.send 'ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', options, id
|
||||
ipc.once "ATOM_RENDERER_DESKTOP_CAPTURER_RESULT_#{id}", (error_message, sources) ->
|
||||
ipcRenderer.send 'ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', options, id
|
||||
ipcRenderer.once "ATOM_RENDERER_DESKTOP_CAPTURER_RESULT_#{id}", (error_message, sources) ->
|
||||
error = if error_message then Error error_message else null
|
||||
callback error, ({id: source.id, name: source.name, thumbnail: NativeImage.createFromDataUrl source.thumbnail} for source in sources)
|
||||
|
||||
module.exports =
|
||||
getSources: getSources
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue