|
@@ -180,22 +180,18 @@ export default class RTC extends Listenable {
|
180
|
180
|
* @param {array} lastNEndpoints the new Last N endpoints.
|
181
|
181
|
* @private
|
182
|
182
|
*/
|
183
|
|
- _onLastNChanged(lastNEndpoints) {
|
184
|
|
- const oldLastNEndpoints = this._lastNEndpoints;
|
|
183
|
+ _onLastNChanged(lastNEndpoints = []) {
|
|
184
|
+ const oldLastNEndpoints = this._lastNEndpoints || [];
|
185
|
185
|
let leavingLastNEndpoints = [];
|
186
|
186
|
let enteringLastNEndpoints = [];
|
187
|
187
|
|
188
|
188
|
this._lastNEndpoints = lastNEndpoints;
|
189
|
189
|
|
190
|
|
- if (oldLastNEndpoints) {
|
191
|
|
- leavingLastNEndpoints = oldLastNEndpoints.filter(
|
192
|
|
- id => !this.isInLastN(id));
|
|
190
|
+ leavingLastNEndpoints = oldLastNEndpoints.filter(
|
|
191
|
+ id => !this.isInLastN(id));
|
193
|
192
|
|
194
|
|
- if (lastNEndpoints) {
|
195
|
|
- enteringLastNEndpoints = lastNEndpoints.filter(
|
196
|
|
- id => oldLastNEndpoints.indexOf(id) === -1);
|
197
|
|
- }
|
198
|
|
- }
|
|
193
|
+ enteringLastNEndpoints = lastNEndpoints.filter(
|
|
194
|
+ id => oldLastNEndpoints.indexOf(id) === -1);
|
199
|
195
|
|
200
|
196
|
this.conference.eventEmitter.emit(
|
201
|
197
|
JitsiConferenceEvents.LAST_N_ENDPOINTS_CHANGED,
|