fix(rn,filmstrip) clear participants cache when changing conferences

This commit is contained in:
Saúl Ibarra Corretgé 2022-10-18 12:11:16 +02:00 committed by Saúl Ibarra Corretgé
parent 4bb1697115
commit a9f5829e58
1 changed files with 12 additions and 1 deletions

View File

@ -3,7 +3,7 @@
import { StateListenerRegistry } from '../base/redux';
import { shouldDisplayTileView } from '../video-layout';
import { setTileViewDimensions } from './actions';
import { setRemoteParticipants, setTileViewDimensions } from './actions';
import { getTileViewParticipantCount } from './functions.native';
import './subscriber.any';
@ -30,3 +30,14 @@ StateListenerRegistry.register(
store.dispatch(setTileViewDimensions());
}
});
/**
* Listens for changes in the current conference and clears remote participants from this feature.
*/
StateListenerRegistry.register(
state => state['features/base/conference'].conference,
(conference, { dispatch }, previousConference) => {
if (conference !== previousConference) {
dispatch(setRemoteParticipants([]));
}
});