diff --git a/src/addon/mod/assign/components/index/addon-mod-assign-index.html b/src/addon/mod/assign/components/index/addon-mod-assign-index.html index edf43166f..aac1c7ea8 100644 --- a/src/addon/mod/assign/components/index/addon-mod-assign-index.html +++ b/src/addon/mod/assign/components/index/addon-mod-assign-index.html @@ -6,7 +6,7 @@ - + diff --git a/src/addon/mod/book/components/index/addon-mod-book-index.html b/src/addon/mod/book/components/index/addon-mod-book-index.html index b5ce9efc2..6f4e0be3a 100644 --- a/src/addon/mod/book/components/index/addon-mod-book-index.html +++ b/src/addon/mod/book/components/index/addon-mod-book-index.html @@ -8,7 +8,7 @@ - + diff --git a/src/addon/mod/chat/components/index/addon-mod-chat-index.html b/src/addon/mod/chat/components/index/addon-mod-chat-index.html index f76b8f8f8..3aaa3b0ce 100644 --- a/src/addon/mod/chat/components/index/addon-mod-chat-index.html +++ b/src/addon/mod/chat/components/index/addon-mod-chat-index.html @@ -5,7 +5,7 @@ - + diff --git a/src/addon/mod/choice/components/index/addon-mod-choice-index.html b/src/addon/mod/choice/components/index/addon-mod-choice-index.html index 59a85ab7b..a9e81b5f6 100644 --- a/src/addon/mod/choice/components/index/addon-mod-choice-index.html +++ b/src/addon/mod/choice/components/index/addon-mod-choice-index.html @@ -6,7 +6,7 @@ - + diff --git a/src/addon/mod/data/components/index/addon-mod-data-index.html b/src/addon/mod/data/components/index/addon-mod-data-index.html index d6c306669..dd2beb9a0 100644 --- a/src/addon/mod/data/components/index/addon-mod-data-index.html +++ b/src/addon/mod/data/components/index/addon-mod-data-index.html @@ -11,7 +11,7 @@ - + diff --git a/src/addon/mod/feedback/components/index/addon-mod-feedback-index.html b/src/addon/mod/feedback/components/index/addon-mod-feedback-index.html index 9fef582e3..bc403c9e0 100644 --- a/src/addon/mod/feedback/components/index/addon-mod-feedback-index.html +++ b/src/addon/mod/feedback/components/index/addon-mod-feedback-index.html @@ -6,7 +6,7 @@ - + diff --git a/src/addon/mod/folder/components/index/addon-mod-folder-index.html b/src/addon/mod/folder/components/index/addon-mod-folder-index.html index 62cda2e8e..c59ab5ac7 100644 --- a/src/addon/mod/folder/components/index/addon-mod-folder-index.html +++ b/src/addon/mod/folder/components/index/addon-mod-folder-index.html @@ -5,7 +5,7 @@ - + diff --git a/src/addon/mod/forum/components/index/addon-mod-forum-index.html b/src/addon/mod/forum/components/index/addon-mod-forum-index.html index 0aecbb757..8a7dae440 100644 --- a/src/addon/mod/forum/components/index/addon-mod-forum-index.html +++ b/src/addon/mod/forum/components/index/addon-mod-forum-index.html @@ -6,7 +6,7 @@ - + diff --git a/src/addon/mod/glossary/components/index/addon-mod-glossary-index.html b/src/addon/mod/glossary/components/index/addon-mod-glossary-index.html index b5617f259..4695adab9 100644 --- a/src/addon/mod/glossary/components/index/addon-mod-glossary-index.html +++ b/src/addon/mod/glossary/components/index/addon-mod-glossary-index.html @@ -10,7 +10,7 @@ - + diff --git a/src/addon/mod/imscp/components/index/addon-mod-imscp-index.html b/src/addon/mod/imscp/components/index/addon-mod-imscp-index.html index eab430fd2..a07aa6be4 100644 --- a/src/addon/mod/imscp/components/index/addon-mod-imscp-index.html +++ b/src/addon/mod/imscp/components/index/addon-mod-imscp-index.html @@ -8,7 +8,7 @@ - + diff --git a/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html b/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html index 5e1c4d20b..55cc163c8 100644 --- a/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html +++ b/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html @@ -6,7 +6,7 @@ - + diff --git a/src/addon/mod/page/components/index/addon-mod-page-index.html b/src/addon/mod/page/components/index/addon-mod-page-index.html index 8c2c78a40..819cef352 100644 --- a/src/addon/mod/page/components/index/addon-mod-page-index.html +++ b/src/addon/mod/page/components/index/addon-mod-page-index.html @@ -5,7 +5,7 @@ - + diff --git a/src/addon/mod/quiz/components/index/addon-mod-quiz-index.html b/src/addon/mod/quiz/components/index/addon-mod-quiz-index.html index 5113cd105..bb204717c 100644 --- a/src/addon/mod/quiz/components/index/addon-mod-quiz-index.html +++ b/src/addon/mod/quiz/components/index/addon-mod-quiz-index.html @@ -6,7 +6,7 @@ - + diff --git a/src/addon/mod/resource/components/index/addon-mod-resource-index.html b/src/addon/mod/resource/components/index/addon-mod-resource-index.html index 7a964f220..45056cdcd 100644 --- a/src/addon/mod/resource/components/index/addon-mod-resource-index.html +++ b/src/addon/mod/resource/components/index/addon-mod-resource-index.html @@ -5,7 +5,7 @@ - + diff --git a/src/addon/mod/scorm/components/index/addon-mod-scorm-index.html b/src/addon/mod/scorm/components/index/addon-mod-scorm-index.html index 92fb199a2..20ca8751f 100644 --- a/src/addon/mod/scorm/components/index/addon-mod-scorm-index.html +++ b/src/addon/mod/scorm/components/index/addon-mod-scorm-index.html @@ -6,7 +6,7 @@ - + diff --git a/src/addon/mod/survey/components/index/addon-mod-survey-index.html b/src/addon/mod/survey/components/index/addon-mod-survey-index.html index 01645b24b..da07713d4 100644 --- a/src/addon/mod/survey/components/index/addon-mod-survey-index.html +++ b/src/addon/mod/survey/components/index/addon-mod-survey-index.html @@ -6,7 +6,7 @@ - + diff --git a/src/addon/mod/wiki/components/index/addon-mod-wiki-index.html b/src/addon/mod/wiki/components/index/addon-mod-wiki-index.html index 0a8a6c5b1..3d8834595 100644 --- a/src/addon/mod/wiki/components/index/addon-mod-wiki-index.html +++ b/src/addon/mod/wiki/components/index/addon-mod-wiki-index.html @@ -18,7 +18,7 @@ - + diff --git a/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html b/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html index f778b5f19..0e2e89af6 100644 --- a/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html +++ b/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html @@ -6,7 +6,7 @@ - + diff --git a/src/core/course/classes/main-resource-component.ts b/src/core/course/classes/main-resource-component.ts index 42727c13f..b2a153add 100644 --- a/src/core/course/classes/main-resource-component.ts +++ b/src/core/course/classes/main-resource-component.ts @@ -251,9 +251,11 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, /** * Prefetch the module. + * + * @param {Function} [done] Function to call when done. */ - prefetch(): void { - this.courseHelper.contextMenuPrefetch(this, this.module, this.courseId); + prefetch(done?: () => void): void { + this.courseHelper.contextMenuPrefetch(this, this.module, this.courseId, done); } /** diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts index 7259db9b8..0a7b95247 100644 --- a/src/core/course/providers/helper.ts +++ b/src/core/course/providers/helper.ts @@ -465,9 +465,10 @@ export class CoreCourseHelperProvider { * @param {any} instance The component instance that has the context menu. It should have prefetchStatusIcon and isDestroyed. * @param {any} module Module to be prefetched * @param {number} courseId Course ID the module belongs to. + * @param {Function} [done] Function to call when done. It will close the context menu. * @return {Promise} Promise resolved when done. */ - contextMenuPrefetch(instance: any, module: any, courseId: number): Promise { + contextMenuPrefetch(instance: any, module: any, courseId: number, done?: () => void): Promise { const initialIcon = instance.prefetchStatusIcon; instance.prefetchStatusIcon = 'spinner'; // Show spinner since this operation might take a while. @@ -477,6 +478,9 @@ export class CoreCourseHelperProvider { return this.domUtils.confirmDownloadSize(size).then(() => { return this.prefetchDelegate.prefetchModule(module, courseId, true); }); + }).then(() => { + // Success, close menu. + done && done(); }).catch((error) => { instance.prefetchStatusIcon = initialIcon; diff --git a/src/core/mainmenu/pages/menu/menu.ts b/src/core/mainmenu/pages/menu/menu.ts index 5f03fb21f..d06d413c2 100644 --- a/src/core/mainmenu/pages/menu/menu.ts +++ b/src/core/mainmenu/pages/menu/menu.ts @@ -171,7 +171,10 @@ export class CoreMainMenuPage implements OnDestroy { if (this.urlToOpen) { // There's a content link to open. - this.linksDelegate.getActionsFor(this.urlToOpen, undefined).then((actions) => { + const url = this.urlToOpen; + delete this.urlToOpen; + + this.linksDelegate.getActionsFor(url, undefined).then((actions) => { const action = this.linksHelper.getFirstValidAction(actions); if (action && action.sites.length) { // Action should only have 1 site because we're filtering by username. diff --git a/src/core/pushnotifications/providers/pushnotifications.ts b/src/core/pushnotifications/providers/pushnotifications.ts index 992a311be..c61bf7a29 100644 --- a/src/core/pushnotifications/providers/pushnotifications.ts +++ b/src/core/pushnotifications/providers/pushnotifications.ts @@ -419,6 +419,7 @@ export class CorePushNotificationsProvider { channel: 'PushPluginChannel' }, promises = [], + isAndroid = this.platform.is('android'), extraFeatures = this.utils.isTrueOrOne(data.extrafeatures); // Apply formatText to title and message. @@ -432,7 +433,7 @@ export class CorePushNotificationsProvider { // Error formatting, use the original message. return notification.message; }).then((formattedMessage) => { - if (extraFeatures && this.utils.isFalseOrZero(data.notif)) { + if (extraFeatures && isAndroid && this.utils.isFalseOrZero(data.notif)) { // It's a message, use messaging style. Ionic Native doesn't specify this option. ( localNotif).text = [ { @@ -445,7 +446,7 @@ export class CorePushNotificationsProvider { } })); - if (extraFeatures) { + if (extraFeatures && isAndroid) { // Use a different icon if needed. localNotif.icon = notification.image; // This feature isn't supported by the official plugin, we use a fork.