Merge pull request #4078 from dpalou/MOBILE-4470
MOBILE-4470 remotethemes: Fix styles not loaded in reconnect in offlinemain
commit
aa08f5a3b0
|
@ -144,6 +144,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
|||
{
|
||||
config: this.siteConfig,
|
||||
loginSuccessful: this.loginSuccessful,
|
||||
siteId: this.siteId,
|
||||
},
|
||||
this.siteId,
|
||||
);
|
||||
|
@ -180,7 +181,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
|||
|
||||
if (!this.eventThrown && !this.viewLeft) {
|
||||
this.eventThrown = true;
|
||||
CoreEvents.trigger(CoreEvents.LOGIN_SITE_CHECKED, { config: this.siteConfig });
|
||||
CoreEvents.trigger(CoreEvents.LOGIN_SITE_CHECKED, { config: this.siteConfig, siteId: this.siteId });
|
||||
}
|
||||
|
||||
this.isBrowserSSO = CoreLoginHelper.isSSOLoginNeeded(this.siteConfig.typeoflogin);
|
||||
|
|
|
@ -148,8 +148,15 @@ export class CoreStylesService {
|
|||
this.removeSite(site.getId());
|
||||
});
|
||||
|
||||
// Load temporary styles when site config is checked in login.
|
||||
// Load temporary styles when site config is checked in login/reconnect.
|
||||
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);
|
||||
});
|
||||
|
@ -163,8 +170,9 @@ export class CoreStylesService {
|
|||
return;
|
||||
}
|
||||
|
||||
// The tmp styles are from a site that wasn't added in the end. Just remove them.
|
||||
// User didn't access the site, unload tmp styles and site styles if any.
|
||||
this.unloadTmpStyles();
|
||||
this.clear();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -428,6 +428,7 @@ export type CoreEventActivityDataSentData = {
|
|||
*/
|
||||
export type CoreEventLoginSiteCheckedData = {
|
||||
config: CoreSitePublicConfigResponse;
|
||||
siteId?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -436,6 +437,7 @@ export type CoreEventLoginSiteCheckedData = {
|
|||
export type CoreEventLoginSiteUncheckedData = {
|
||||
config?: CoreSitePublicConfigResponse;
|
||||
loginSuccessful: boolean;
|
||||
siteId?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue