From 188808d41e77da70c73a3f5570c7202d7c4d72d9 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 3 Jun 2024 10:11:40 +0200 Subject: [PATCH] MOBILE-4470 remotethemes: Revert fix styles not loaded in offline This reverts commit f75bfd39d15ae8efb9907cfa73474a1029da47c8. --- src/core/features/login/pages/reconnect/reconnect.ts | 3 +-- src/core/features/styles/services/styles.ts | 12 ++---------- src/core/singletons/events.ts | 2 -- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/core/features/login/pages/reconnect/reconnect.ts b/src/core/features/login/pages/reconnect/reconnect.ts index 03d2958cb..999e63786 100644 --- a/src/core/features/login/pages/reconnect/reconnect.ts +++ b/src/core/features/login/pages/reconnect/reconnect.ts @@ -144,7 +144,6 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy { { config: this.siteConfig, loginSuccessful: this.loginSuccessful, - siteId: this.siteId, }, this.siteId, ); @@ -181,7 +180,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy { if (!this.eventThrown && !this.viewLeft) { this.eventThrown = true; - CoreEvents.trigger(CoreEvents.LOGIN_SITE_CHECKED, { config: this.siteConfig, siteId: this.siteId }); + CoreEvents.trigger(CoreEvents.LOGIN_SITE_CHECKED, { config: this.siteConfig }); } this.isBrowserSSO = CoreLoginHelper.isSSOLoginNeeded(this.siteConfig.typeoflogin); diff --git a/src/core/features/styles/services/styles.ts b/src/core/features/styles/services/styles.ts index a62ee264e..67ea5f19a 100644 --- a/src/core/features/styles/services/styles.ts +++ b/src/core/features/styles/services/styles.ts @@ -148,15 +148,8 @@ export class CoreStylesService { this.removeSite(site.getId()); }); - // Load temporary styles when site config is checked in login/reconnect. + // Load temporary styles when site config is checked in login. CoreEvents.on(CoreEvents.LOGIN_SITE_CHECKED, (data) => { - if (data.siteId) { - // Reconnecting to a site, enable the site styles. - this.enableSiteStyles(data.siteId); - - return; - } - this.loadTmpStyles(data.config).catch((error) => { this.logger.error('Error loading tmp styles', error); }); @@ -170,9 +163,8 @@ export class CoreStylesService { return; } - // User didn't access the site, unload tmp styles and site styles if any. + // The tmp styles are from a site that wasn't added in the end. Just remove them. this.unloadTmpStyles(); - this.clear(); }); } diff --git a/src/core/singletons/events.ts b/src/core/singletons/events.ts index 340ec0319..cc8eab779 100644 --- a/src/core/singletons/events.ts +++ b/src/core/singletons/events.ts @@ -428,7 +428,6 @@ export type CoreEventActivityDataSentData = { */ export type CoreEventLoginSiteCheckedData = { config: CoreSitePublicConfigResponse; - siteId?: string; }; /** @@ -437,7 +436,6 @@ export type CoreEventLoginSiteCheckedData = { export type CoreEventLoginSiteUncheckedData = { config?: CoreSitePublicConfigResponse; loginSuccessful: boolean; - siteId?: string; }; /**