From c506845a382b53c0f00320d376325de4c1fcf8ea Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Mon, 18 Jun 2018 17:10:20 +0200 Subject: [PATCH 1/4] MOBILE-2431 login: Fix forgotten password page --- .../login/pages/forgotten-password/forgotten-password.module.ts | 2 ++ 1 file changed, 2 insertions(+) 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() ] From e286e93918201b5c33e999af064fb70a05b8e837 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Tue, 19 Jun 2018 10:55:38 +0200 Subject: [PATCH 2/4] MOBILE-2431 survey: Fix sync --- src/addon/mod/survey/providers/offline.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }); }); } From cbd155343807d28c60e82660ba380e893ab00181 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Tue, 19 Jun 2018 11:12:52 +0200 Subject: [PATCH 3/4] MOBILE-2431 chat: Scroll to bottom when receiving a beep --- src/addon/mod/chat/pages/chat/chat.ts | 4 ++++ 1 file changed, 4 insertions(+) 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()); + } }); }); } From ddac8483d5aef4653aec43def2df5ff1c65614dd Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Tue, 19 Jun 2018 13:00:28 +0200 Subject: [PATCH 4/4] MOBILE-2431 renotethemes: Fix remote styles not enabled after adding a site --- src/addon/remotethemes/remotethemes.module.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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();