Compare commits

...

1 Commits

Author SHA1 Message Date
Travis McLane 0e0db50dea ensure event listener is activated (hooks)
The OS X delegate listener for an event is only activated if the
`on` call is made for the event id.
This is an optimization to prevent flooding the application with
events that the application does not actually care about.
The `impl.on` call is what activates the response handler for the
event in question.  This logic was missing in the RegisterHooks()
function but is present in the `On()` function.  In the case of using
`On()` first followed by `RegisterHooks()` things work correctly.
2024-04-26 13:47:08 -05:00
+3
View File
@@ -397,6 +397,9 @@ func (a *App) RegisterHook(eventType events.ApplicationEventType, callback func(
callback: callback,
}
a.applicationEventHooks[eventID] = append(a.applicationEventHooks[eventID], thisHook)
if a.impl != nil {
go a.impl.on(eventID)
}
return func() {
a.applicationEventHooksLock.Lock()