Skip to content

Commit

Permalink
Merge pull request #4250 from dpalou/MOBILE-4653
Browse files Browse the repository at this point in the history
MOBILE-4653 delegate: Fix regression in hasHandlers
  • Loading branch information
crazyserver authored Nov 28, 2024
2 parents fd78763 + 00d92e1 commit 9dd6d8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/classes/delegate-sorted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/classes/delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 9dd6d8f

Please sign in to comment.