diff --git a/src/addon/mod/chat/pages/chat/chat.ts b/src/addon/mod/chat/pages/chat/chat.ts index ba18844d4..082509e21 100644 --- a/src/addon/mod/chat/pages/chat/chat.ts +++ b/src/addon/mod/chat/pages/chat/chat.ts @@ -139,6 +139,10 @@ export class AddonModChatChatPage { return this.chatProvider.getMessagesUserData(messagesInfo.messages, this.courseId).then((messages) => { this.messages = this.messages.concat(messages); + if (messages.length) { + // New messages or beeps, scroll to bottom. + setTimeout(() => this.scrollToBottom()); + } }); }); } diff --git a/src/addon/mod/survey/providers/offline.ts b/src/addon/mod/survey/providers/offline.ts index 2a9faafa1..6e3ce13a4 100644 --- a/src/addon/mod/survey/providers/offline.ts +++ b/src/addon/mod/survey/providers/offline.ts @@ -90,9 +90,11 @@ export class AddonModSurveyOfflineProvider { getAllData(siteId?: string): Promise { return this.sitesProvider.getSite(siteId).then((site) => { return site.getDb().getAllRecords(AddonModSurveyOfflineProvider.SURVEY_TABLE).then((entries) => { - return entries.map((entry) => { + entries.forEach((entry) => { entry.answers = this.textUtils.parseJSON(entry.answers); }); + + return entries; }); }); } diff --git a/src/addon/remotethemes/remotethemes.module.ts b/src/addon/remotethemes/remotethemes.module.ts index 6fa5a1dd7..72475434b 100644 --- a/src/addon/remotethemes/remotethemes.module.ts +++ b/src/addon/remotethemes/remotethemes.module.ts @@ -54,8 +54,7 @@ export class AddonRemoteThemesModule { load: remoteThemesProvider.preloadSites.bind(remoteThemesProvider) }); - let addingSite, - unloadTmpStyles; + let addingSite; // When a new site is added to the app, add its styles. eventsProvider.on(CoreEventsProvider.SITE_ADDED, (data) => { @@ -68,9 +67,10 @@ export class AddonRemoteThemesModule { addingSite = false; } - if (unloadTmpStyles == data.siteId) { - // This site had some tmp styles loaded, unload them. + // User has logged in, remove tmp styles and enable loaded styles. + if (data.siteId == sitesProvider.getCurrentSiteId()) { remoteThemesProvider.unloadTmpStyles(); + remoteThemesProvider.enable(data.siteId); } }); }); @@ -86,6 +86,7 @@ export class AddonRemoteThemesModule { // Enable styles of current site on login. eventsProvider.on(CoreEventsProvider.LOGIN, (data) => { + remoteThemesProvider.unloadTmpStyles(); remoteThemesProvider.enable(data.siteId); }); @@ -106,10 +107,9 @@ export class AddonRemoteThemesModule { // Unload temporary styles when site config is "unchecked" in login. eventsProvider.on(CoreEventsProvider.LOGIN_SITE_UNCHECKED, (data) => { - if (data.siteId && data.siteid == addingSite) { + if (data.siteId && data.siteId === addingSite) { // The tmp styles are from a site that is being added permanently. // Wait for the final site styles to be loaded before removing the tmp styles so there is no blink effect. - unloadTmpStyles = data.siteId; } else { // The tmp styles are from a site that wasn't added in the end. Just remove them. remoteThemesProvider.unloadTmpStyles(); diff --git a/src/core/login/pages/forgotten-password/forgotten-password.module.ts b/src/core/login/pages/forgotten-password/forgotten-password.module.ts index 0df3a92da..050a769f8 100644 --- a/src/core/login/pages/forgotten-password/forgotten-password.module.ts +++ b/src/core/login/pages/forgotten-password/forgotten-password.module.ts @@ -14,6 +14,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; +import { CoreDirectivesModule } from '@directives/directives.module'; import { CoreLoginForgottenPasswordPage } from './forgotten-password'; import { TranslateModule } from '@ngx-translate/core'; @@ -22,6 +23,7 @@ import { TranslateModule } from '@ngx-translate/core'; CoreLoginForgottenPasswordPage ], imports: [ + CoreDirectivesModule, IonicPageModule.forChild(CoreLoginForgottenPasswordPage), TranslateModule.forChild() ]