commit
f17ae52a15
|
@ -154,6 +154,16 @@ export class MoodleMobileApp implements OnInit {
|
|||
}
|
||||
});
|
||||
|
||||
this.eventsProvider.on(CoreEventsProvider.SITE_ADDED, (data) => {
|
||||
if (data.siteId == this.sitesProvider.getCurrentSiteId()) {
|
||||
loadCustomStrings();
|
||||
|
||||
// Add version classes to body.
|
||||
this.removeVersionClass();
|
||||
this.addVersionClass(this.sitesProvider.getReleaseNumber(data.release || ''));
|
||||
}
|
||||
});
|
||||
|
||||
// Pause Youtube videos in Android when app is put in background or screen is locked.
|
||||
this.platform.pause.subscribe(() => {
|
||||
if (!this.platform.is('android')) {
|
||||
|
|
|
@ -158,6 +158,7 @@ export class CoreSiteHomeIndexComponent implements OnInit {
|
|||
if (canGetBlocks) {
|
||||
this.domUtils.showErrorModal(error);
|
||||
}
|
||||
this.blocks = [];
|
||||
|
||||
// Cannot get the blocks, just show site main menu if needed.
|
||||
if (sections[0] && this.courseHelper.sectionHasContent(sections[0])) {
|
||||
|
@ -166,7 +167,6 @@ export class CoreSiteHomeIndexComponent implements OnInit {
|
|||
});
|
||||
this.hasSupportedBlock = true;
|
||||
} else {
|
||||
this.blocks = [];
|
||||
this.hasSupportedBlock = false;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -488,7 +488,7 @@ export class CoreSitesProvider {
|
|||
this.sites[siteId] = candidateSite;
|
||||
// Store session.
|
||||
this.login(siteId);
|
||||
this.eventsProvider.trigger(CoreEventsProvider.SITE_ADDED, {}, siteId);
|
||||
this.eventsProvider.trigger(CoreEventsProvider.SITE_ADDED, info, siteId);
|
||||
|
||||
if (this.siteTablesSchemas.length) {
|
||||
// Create tables in the site's database.
|
||||
|
|
Loading…
Reference in New Issue