Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(lastN) simplify lastN calculation when in background (#15018)

Saúl Ibarra Corretgé445515da93c5
diff --git a/react/features/base/lastn/middleware.ts b/react/features/base/lastn/middleware.ts
index aae1190eda..6b000181ff 100644
--- a/react/features/base/lastn/middleware.ts
+++ b/react/features/base/lastn/middleware.ts
@@ -11,7 +11,6 @@ import { SET_AUDIO_ONLY } from '../audio-only/actionTypes';
import { CONFERENCE_JOINED } from '../conference/actionTypes';
import { getParticipantById } from '../participants/functions';
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
-import { isLocalVideoTrackDesktop } from '../tracks/functions';
import { setLastN } from './actions';
import logger from './logger';
@@ -45,9 +44,7 @@ const _updateLastN = debounce(({ dispatch, getState }: IStore) => {
// 3. -1 as the default value.
let lastNSelected = config.startLastN ?? (config.channelLastN ?? -1);
- if (typeof appState !== 'undefined' && appState !== 'active') {
- lastNSelected = isLocalVideoTrackDesktop(state) ? 1 : 0;
- } else if (carMode) {
+ if (appState === 'background' || carMode) {
lastNSelected = 0;
} else if (audioOnly) {
const { remoteScreenShares, tileViewEnabled } = state['features/video-layout'];