Use EventEmitter public methods instead of _events.
This commit is contained in:
parent
45986405b8
commit
63d8137da2
1 changed files with 4 additions and 6 deletions
|
@ -151,13 +151,11 @@ const rendererMissingErrorMessage = (meta, args, callIntoRenderer) => {
|
||||||
`\nFunction provided here: ${meta.location}`
|
`\nFunction provided here: ${meta.location}`
|
||||||
|
|
||||||
if (args.length === 0) return message
|
if (args.length === 0) return message
|
||||||
if (!args[0].sender || !args[0].sender._events) return message
|
if (!args[0].sender || !args[0].sender.eventNames) return message
|
||||||
|
|
||||||
const eventsAttached = args[0].sender._events
|
const sender = args[0].sender
|
||||||
const remoteEvents = Object.keys(eventsAttached).filter((eventName) => {
|
const remoteEvents = sender.eventNames().filter((eventName) => {
|
||||||
return Array.isArray(eventsAttached[eventName])
|
return sender.listeners(eventName).includes(callIntoRenderer);
|
||||||
? eventsAttached[eventName].includes(callIntoRenderer)
|
|
||||||
: eventsAttached[eventName] === callIntoRenderer
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (remoteEvents.length > 0) {
|
if (remoteEvents.length > 0) {
|
||||||
|
|
Loading…
Reference in a new issue