diff --git a/src/addon/mod/assign/providers/prefetch-handler.ts b/src/addon/mod/assign/providers/prefetch-handler.ts index d7a86836a..93ecb3f68 100644 --- a/src/addon/mod/assign/providers/prefetch-handler.ts +++ b/src/addon/mod/assign/providers/prefetch-handler.ts @@ -392,7 +392,7 @@ export class AddonModAssignPrefetchHandler extends CoreCourseActivityPrefetchHan // Prefetch feedback. if (submission.feedback) { // Get profile and image of the grader. - if (submission.feedback.grade && submission.feedback.grade.grader) { + if (submission.feedback.grade && submission.feedback.grade.grader && submission.feedback.grade.grader != -1) { userIds.push(submission.feedback.grade.grader); } diff --git a/src/core/login/providers/helper.ts b/src/core/login/providers/helper.ts index 9cebad238..77d06b08c 100644 --- a/src/core/login/providers/helper.ts +++ b/src/core/login/providers/helper.ts @@ -179,10 +179,10 @@ export class CoreLoginHelperProvider { } else { this.goToSiteInitialPage(); } - }).catch((errorMessage) => { - if (errorMessage) { + }).catch((error) => { + if (error) { // An error occurred, display the error and logout the user. - this.domUtils.showErrorModal(errorMessage); + this.treatUserTokenError(siteData.siteUrl, error); this.sitesProvider.logout(); } }).finally(() => { @@ -561,8 +561,8 @@ export class CoreLoginHelperProvider { * @return {boolean} True if embedded browser, false othwerise. */ isSSOEmbeddedBrowser(code: number): boolean { - if (this.appProvider.isLinux()) { - // In Linux desktop apps, always use embedded browser. + if (this.appProvider.isLinux() || this.appProvider.isMac()) { + // In Linux and Mac desktop apps, always use embedded browser. return true; } @@ -647,8 +647,8 @@ export class CoreLoginHelperProvider { loginUrl += '&oauthsso=' + params.id; - if (this.appProvider.isLinux()) { - // In Linux desktop apps, always use embedded browser. + if (this.appProvider.isLinux() || this.appProvider.isMac()) { + // In Linux and Mac desktop apps, always use embedded browser. this.utils.openInApp(loginUrl); } else { // Always open it in browser because the user might have the session stored in there. diff --git a/src/core/user/providers/user.ts b/src/core/user/providers/user.ts index 2a4d83d47..242c586d6 100644 --- a/src/core/user/providers/user.ts +++ b/src/core/user/providers/user.ts @@ -397,7 +397,7 @@ export class CoreUserProvider { userId = Number(userId); // Make sure it's a number. // Prevent repeats and errors. - if (!isNaN(userId) && !treated[userId]) { + if (!isNaN(userId) && !treated[userId] && userId > 0) { treated[userId] = true; promises.push(this.getProfile(userId, courseId, false, siteId).then((profile) => { diff --git a/src/providers/utils/dom.ts b/src/providers/utils/dom.ts index 05f86a032..d026def15 100644 --- a/src/providers/utils/dom.ts +++ b/src/providers/utils/dom.ts @@ -140,13 +140,12 @@ export class CoreDomUtilsProvider { const readableSize = this.textUtils.bytesToSize(size.size, 2); return this.showConfirm(this.translate.instant('core.course.confirmpartialdownloadsize', { size: readableSize })); - } else if (size.size >= wifiThreshold || (this.appProvider.isNetworkAccessLimited() && size.size >= limitedThreshold)) { + } else if (alwaysConfirm || size.size >= wifiThreshold || + (this.appProvider.isNetworkAccessLimited() && size.size >= limitedThreshold)) { message = message || 'core.course.confirmdownload'; const readableSize = this.textUtils.bytesToSize(size.size, 2); return this.showConfirm(this.translate.instant(message, { size: readableSize })); - } else if (alwaysConfirm) { - return this.showConfirm(this.translate.instant('core.areyousure')); } return Promise.resolve();