MOBILE-2722 site: Add version class when adding site

main
Pau Ferrer Ocaña 2018-12-21 13:42:37 +01:00
parent 84d6ea5118
commit 597480c48f
2 changed files with 11 additions and 1 deletions

View File

@ -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')) {

View File

@ -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.