Browse Source

fix(lastN) fix last N getting stuck on 1

If last N goes down to 1 it will be stuck there since it's > 0 and will
be our `lastNSelected`. When limits are applied we'll take the minimum,
so it will end up being 1.

Once can end up in last N being 1 by several means, the more obvious one
by entering Picture-in-Picture mode on mobile.

Fix it by not using the previous last N value for the current
calculation, at all.

Fixes: https://github.com/jitsi/jitsi-meet/issues/10257
Closes: https://github.com/jitsi/jitsi-meet/pull/10491
master
Saúl Ibarra Corretgé 3 years ago
parent
commit
4d2bd932a7
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      react/features/base/lastn/middleware.js

+ 6
- 7
react/features/base/lastn/middleware.js View File

@@ -49,15 +49,14 @@ const _updateLastN = debounce(({ dispatch, getState }) => {
49 49
     const { appState } = state['features/background'] || {};
50 50
     const { enabled: filmStripEnabled } = state['features/filmstrip'];
51 51
     const config = state['features/base/config'];
52
-    const { lastNLimits, lastN } = state['features/base/lastn'];
52
+    const { lastNLimits } = state['features/base/lastn'];
53 53
     const participantCount = getParticipantCount(state);
54 54
 
55
-    // Select the lastN value based on the following preference order.
56
-    // 1. The last-n value in redux.
57
-    // 2. The last-n value from 'startLastN' if it is specified in config.js
58
-    // 3. The last-n value from 'channelLastN' if specified in config.js.
59
-    // 4. -1 as the default value.
60
-    let lastNSelected = lastN || (config.startLastN ?? (config.channelLastN ?? -1));
55
+    // Select the (initial) lastN value based on the following preference order.
56
+    // 1. The last-n value from 'startLastN' if it is specified in config.js
57
+    // 2. The last-n value from 'channelLastN' if specified in config.js.
58
+    // 3. -1 as the default value.
59
+    let lastNSelected = config.startLastN ?? (config.channelLastN ?? -1);
61 60
 
62 61
     // Apply last N limit based on the # of participants and config settings.
63 62
     const limitedLastN = limitLastN(participantCount, lastNLimits);

Loading…
Cancel
Save