diff --git a/src/addons/remotethemes/services/remotethemes-handler.ts b/src/addons/remotethemes/services/remotethemes-handler.ts index 46bbdc1d000..16b48f12624 100644 --- a/src/addons/remotethemes/services/remotethemes-handler.ts +++ b/src/addons/remotethemes/services/remotethemes-handler.ts @@ -54,7 +54,7 @@ export class AddonRemoteThemesHandlerService implements CoreStyleHandler { * @inheritDoc */ async getStyle(siteId: string, config?: CoreSitePublicConfigResponse): Promise { - if (siteId == CoreStylesService.TMP_SITE_ID) { + if (siteId === CoreStylesService.TMP_SITE_ID) { if (!config) { return ''; } diff --git a/src/core/features/login/pages/reconnect/reconnect.ts b/src/core/features/login/pages/reconnect/reconnect.ts index 999e6378618..62215d0d594 100644 --- a/src/core/features/login/pages/reconnect/reconnect.ts +++ b/src/core/features/login/pages/reconnect/reconnect.ts @@ -261,10 +261,10 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy { if (error.loggedout) { this.cancel(); - } else if (error.errorcode == 'forcepasswordchangenotice') { + } else if (error.errorcode === 'forcepasswordchangenotice') { // Reset password field. this.credForm.controls.password.reset(); - } else if (error.errorcode == 'invalidlogin') { + } else if (error.errorcode === 'invalidlogin') { this.reconnectAttempts++; } } finally { diff --git a/src/core/features/login/pages/site/site.ts b/src/core/features/login/pages/site/site.ts index 3e93bc137d6..fdb6b28eb8d 100644 --- a/src/core/features/login/pages/site/site.ts +++ b/src/core/features/login/pages/site/site.ts @@ -79,7 +79,7 @@ export class CoreLoginSitePage implements OnInit { constructor(protected formBuilder: FormBuilder) {} /** - * Initialize the component. + * @inheritdoc */ async ngOnInit(): Promise { let url = ''; diff --git a/src/core/services/sites.ts b/src/core/services/sites.ts index 4a3353d9425..e2d80c06f45 100644 --- a/src/core/services/sites.ts +++ b/src/core/services/sites.ts @@ -109,7 +109,7 @@ export class CoreSitesProvider { } /** - * Initialize. + * @inheritdoc */ initialize(): void { // Initialize general site events. @@ -160,6 +160,16 @@ export class CoreSitesProvider { CoreHTMLClasses.addSiteUrlClass(data.config.httpswwwroot); }); + // Unload temporary styles when site config is "unchecked" in login. + CoreEvents.on(CoreEvents.LOGIN_SITE_UNCHECKED, ({ loginSuccessful }) => { + if (loginSuccessful) { + // The classes are already added in LOGIN_SITE_CHECKED. + return; + } + + CoreHTMLClasses.removeSiteClasses(); + }); + CoreEvents.on(CoreEvents.SITE_UPDATED, async (data) => { if (data.siteId !== CoreSites.getCurrentSiteId()) { return; @@ -647,7 +657,7 @@ export class CoreSitesProvider { this.currentSite = site; // Store session. await this.login(siteId); - } else if (this.currentSite && this.currentSite.getId() == siteId) { + } else if (this.currentSite && this.currentSite.getId() === siteId) { // Current site has just been updated, trigger the event. CoreEvents.trigger(CoreEvents.SITE_UPDATED, info, siteId); }