From 396d221961cce17e13f0042cf628b1545ee4ffd4 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 18 Jan 2022 10:33:46 +0100 Subject: [PATCH] MOBILE-3833 core: Fix unable to reconnect (main/subscription path) --- src/core/classes/delegate-sorted.ts | 2 ++ src/core/services/navigator.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/classes/delegate-sorted.ts b/src/core/classes/delegate-sorted.ts index d9e6069d7..194a9ff2e 100644 --- a/src/core/classes/delegate-sorted.ts +++ b/src/core/classes/delegate-sorted.ts @@ -46,6 +46,8 @@ export class CoreSortedDelegate< this.clearSortedHandlers(); } }); + // Clear loaded handlers on login, there could be an invalid list loaded when user reconnects after token expired. + CoreEvents.on(CoreEvents.LOGIN, this.clearSortedHandlers.bind(this)); } /** diff --git a/src/core/services/navigator.ts b/src/core/services/navigator.ts index a807a74ee..344ad2822 100644 --- a/src/core/services/navigator.ts +++ b/src/core/services/navigator.ts @@ -581,7 +581,7 @@ export class CoreNavigatorService { return ''; } - const handlers = CoreMainMenuDelegate.getHandlers(); + const handlers = CoreMainMenuDelegate.getHandlers().filter((handler) => !handler.onlyInMore); return handlers[0]?.page || ''; }