From 00d92e1f0e5cb5d543f68a63973272faf20c4908 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 28 Nov 2024 12:52:35 +0100 Subject: [PATCH] MOBILE-4653 delegate: Fix regression in hasHandlers --- src/core/classes/delegate-sorted.ts | 2 +- src/core/classes/delegate.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/classes/delegate-sorted.ts b/src/core/classes/delegate-sorted.ts index a71aa1677..acc8479c5 100644 --- a/src/core/classes/delegate-sorted.ts +++ b/src/core/classes/delegate-sorted.ts @@ -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; } /** diff --git a/src/core/classes/delegate.ts b/src/core/classes/delegate.ts index b491379c8..74bb8bce0 100644 --- a/src/core/classes/delegate.ts +++ b/src/core/classes/delegate.ts @@ -214,7 +214,7 @@ export class CoreDelegate { * @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; } /**