Merge pull request #4250 from dpalou/MOBILE-4653

MOBILE-4653 delegate: Fix regression in hasHandlers
main
Pau Ferrer Ocaña 2024-11-28 13:14:10 +01:00 committed by GitHub
commit 9dd6d8f17d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ export class CoreSortedDelegate<
* @inheritdoc * @inheritdoc
*/ */
hasHandlers(enabled = false): boolean { 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. * @returns True if there's any registered handler, false otherwise.
*/ */
hasHandlers(enabled = false): boolean { hasHandlers(enabled = false): boolean {
return enabled ? !!this.enabledHandlers.length : !!this.handlers.length; return enabled ? !!Object.keys(this.enabledHandlers).length : !!Object.keys(this.handlers).length;
} }
/** /**