MOBILE-3903 enrol: Fix ask password when click enrol link

main
Dani Palou 2021-11-04 10:13:13 +01:00
parent 7618da4bfa
commit 2de6c75f2a
1 changed files with 3 additions and 3 deletions

View File

@ -284,15 +284,15 @@ export class CoreCoursesCourseLinkHandlerService extends CoreContentLinksHandler
} catch (error) { } catch (error) {
modal.dismiss(); modal.dismiss();
if (error && error.code === CoreCoursesProvider.ENROL_INVALID_KEY) { if (error && error.errorcode === CoreCoursesProvider.ENROL_INVALID_KEY) {
// Invalid password. Allow the user to input password. // Invalid password. Allow the user to input password.
const title = Translate.instant('core.courses.selfenrolment'); const title = Translate.instant('core.courses.selfenrolment');
const body = ' '; // Empty message. let body = ' '; // Empty message.
const placeholder = Translate.instant('core.courses.password'); const placeholder = Translate.instant('core.courses.password');
if (typeof password != 'undefined') { if (typeof password != 'undefined') {
// The user attempted a password. Show an error message. // The user attempted a password. Show an error message.
CoreDomUtils.showErrorModal(error); body = CoreTextUtils.getErrorMessageFromError(error) || body;
} }
password = await CoreDomUtils.showPrompt(body, title, placeholder); password = await CoreDomUtils.showPrompt(body, title, placeholder);