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;
|
const { name } = request;
|
||||||
|
|
||||||
switch (name) {
|
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
|
// The store should be already available because API.init is called
|
||||||
// on appWillMount action.
|
// on appWillMount action.
|
||||||
APP.store.dispatch(
|
APP.store.dispatch(
|
||||||
invite(request.invitees, true))
|
invite(invitees, true))
|
||||||
.then(failedInvitees => {
|
.then(failedInvitees => {
|
||||||
let error;
|
let error;
|
||||||
let result;
|
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._isLargeVideoVisible = true;
|
||||||
this._numberOfParticipants = 0;
|
this._numberOfParticipants = 0;
|
||||||
this._participants = {};
|
this._participants = {};
|
||||||
|
@ -597,6 +599,10 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||||
* @returns {Promise} - Resolves on success and rejects on failure.
|
* @returns {Promise} - Resolves on success and rejects on failure.
|
||||||
*/
|
*/
|
||||||
invite(invitees) {
|
invite(invitees) {
|
||||||
|
if (!Array.isArray(invitees) || invitees.length === 0) {
|
||||||
|
return Promise.reject(new TypeError('Invalid Argument'));
|
||||||
|
}
|
||||||
|
|
||||||
return this._transport.sendRequest({
|
return this._transport.sendRequest({
|
||||||
name: 'invite',
|
name: 'invite',
|
||||||
invitees
|
invitees
|
||||||
|
|
Loading…
Reference in New Issue