fix(lastN): Do not override channelLastN value.

If limitLastN values are specified and channelLastN < limitLastN, configure channelLastN on the conference.
This commit is contained in:
Jaya Allamsetty 2020-11-19 16:34:28 -05:00 committed by Jaya Allamsetty
parent 1ee7e81918
commit fc694641dc
1 changed files with 3 additions and 4 deletions

View File

@ -68,14 +68,13 @@ function _updateLastN({ getState }) {
return;
}
const defaultLastN = typeof config.channelLastN === 'undefined' ? -1 : config.channelLastN;
let lastN = defaultLastN;
let lastN = typeof config.channelLastN === 'undefined' ? -1 : config.channelLastN;
// Apply last N limit based on the # of participants
// Apply last N limit based on the # of participants and channelLastN settings.
const limitedLastN = limitLastN(participantCount, lastNLimits);
if (limitedLastN !== undefined) {
lastN = limitedLastN;
lastN = lastN === -1 ? limitedLastN : Math.min(limitedLastN, lastN);
}
if (typeof appState !== 'undefined' && appState !== 'active') {