MOBILE-4653 delegate: Fix regression in hasHandlers

main
Dani Palou 2024-11-28 12:52:35 +01:00
parent fd78763c24
commit 00d92e1f0e
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ export class CoreSortedDelegate<
* @inheritdoc
*/
hasHandlers(enabled = false): boolean {
return enabled ? !!this.sortedHandlers.length : !!this.handlers.length;
return enabled ? !!this.sortedHandlers.length : !!Object.keys(this.handlers).length;
}
/**

View File

@ -214,7 +214,7 @@ export class CoreDelegate<HandlerType extends CoreDelegateHandler> {
* @returns True if there's any registered handler, false otherwise.
*/
hasHandlers(enabled = false): boolean {
return enabled ? !!this.enabledHandlers.length : !!this.handlers.length;
return enabled ? !!Object.keys(this.enabledHandlers).length : !!Object.keys(this.handlers).length;
}
/**