fix(invite): IFrame api when invalid invitees are passed.
This commit is contained in:
parent
fb75180632
commit
bd8559fad6
|
@ -112,11 +112,21 @@ function initCommands() {
|
|||
const { name } = request;
|
||||
|
||||
switch (name) {
|
||||
case 'invite':
|
||||
case 'invite': // eslint-disable-line no-case-declarations
|
||||
const { invitees } = request;
|
||||
|
||||
if (!Array.isArray(invitees) || invitees.length === 0) {
|
||||
callback({
|
||||
error: new Error('Unexpected format of invitees')
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// The store should be already available because API.init is called
|
||||
// on appWillMount action.
|
||||
APP.store.dispatch(
|
||||
invite(request.invitees, true))
|
||||
invite(invitees, true))
|
||||
.then(failedInvitees => {
|
||||
let error;
|
||||
let result;
|
||||
|
|
|
@ -238,7 +238,9 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
|||
}
|
||||
})
|
||||
});
|
||||
this.invite(invitees);
|
||||
if (Array.isArray(invitees) && invitees.length > 0) {
|
||||
this.invite(invitees);
|
||||
}
|
||||
this._isLargeVideoVisible = true;
|
||||
this._numberOfParticipants = 0;
|
||||
this._participants = {};
|
||||
|
@ -597,6 +599,10 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
|||
* @returns {Promise} - Resolves on success and rejects on failure.
|
||||
*/
|
||||
invite(invitees) {
|
||||
if (!Array.isArray(invitees) || invitees.length === 0) {
|
||||
return Promise.reject(new TypeError('Invalid Argument'));
|
||||
}
|
||||
|
||||
return this._transport.sendRequest({
|
||||
name: 'invite',
|
||||
invitees
|
||||
|
|
Loading…
Reference in New Issue