MOBILE-3833 bbb: Improve error message when user not in group

main
Dani Palou 2022-04-22 09:42:34 +02:00
parent b398b084b5
commit b0f090061b
3 changed files with 18 additions and 8 deletions

View File

@ -461,6 +461,7 @@
"addon.mod_bigbluebuttonbn.view_message_session_started_at": "bigbluebuttonbn", "addon.mod_bigbluebuttonbn.view_message_session_started_at": "bigbluebuttonbn",
"addon.mod_bigbluebuttonbn.view_message_viewer": "bigbluebuttonbn", "addon.mod_bigbluebuttonbn.view_message_viewer": "bigbluebuttonbn",
"addon.mod_bigbluebuttonbn.view_message_viewers": "bigbluebuttonbn", "addon.mod_bigbluebuttonbn.view_message_viewers": "bigbluebuttonbn",
"addon.mod_bigbluebuttonbn.view_nojoin": "bigbluebuttonbn",
"addon.mod_book.errorchapter": "book", "addon.mod_book.errorchapter": "book",
"addon.mod_book.modulenameplural": "book", "addon.mod_book.modulenameplural": "book",
"addon.mod_book.navnexttitle": "book", "addon.mod_book.navnexttitle": "book",

View File

@ -81,6 +81,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
return; return;
} }
try {
this.meetingInfo = await AddonModBBB.getMeetingInfo(this.bbb.id, this.groupId, { this.meetingInfo = await AddonModBBB.getMeetingInfo(this.bbb.id, this.groupId, {
cmId: this.module.id, cmId: this.module.id,
}); });
@ -91,6 +92,13 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
this.meetingInfo.statusmessage = Translate.instant('addon.mod_bigbluebuttonbn.userlimitreached'); this.meetingInfo.statusmessage = Translate.instant('addon.mod_bigbluebuttonbn.userlimitreached');
} }
} }
} catch (error) {
if (error && error.errorcode === 'restrictedcontextexception') {
error.message = Translate.instant('addon.mod_bigbluebuttonbn.view_nojoin');
}
throw error;
}
} }
/** /**

View File

@ -14,5 +14,6 @@
"view_message_moderators": "moderators", "view_message_moderators": "moderators",
"view_message_session_started_at": "This session started at", "view_message_session_started_at": "This session started at",
"view_message_viewer": "viewer", "view_message_viewer": "viewer",
"view_message_viewers": "viewers" "view_message_viewers": "viewers",
"view_nojoin": "You do not have a role that is allowed to join this session."
} }