|
|
@@ -2,13 +2,14 @@
|
|
2
|
2
|
|
|
3
|
3
|
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../app';
|
|
4
|
4
|
import { CONFERENCE_LEFT, CONFERENCE_WILL_JOIN } from '../conference';
|
|
5
|
|
-import { MiddlewareRegistry } from '../redux';
|
|
|
5
|
+import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
|
|
6
|
6
|
import UIEvents from '../../../../service/UI/UIEvents';
|
|
7
|
7
|
import { playSound, registerSound, unregisterSound } from '../sounds';
|
|
8
|
8
|
|
|
9
|
9
|
import {
|
|
10
|
10
|
localParticipantIdChanged,
|
|
11
|
11
|
localParticipantJoined,
|
|
|
12
|
+ participantLeft,
|
|
12
|
13
|
participantUpdated
|
|
13
|
14
|
} from './actions';
|
|
14
|
15
|
import {
|
|
|
@@ -124,6 +125,26 @@ MiddlewareRegistry.register(store => next => action => {
|
|
124
|
125
|
return next(action);
|
|
125
|
126
|
});
|
|
126
|
127
|
|
|
|
128
|
+/**
|
|
|
129
|
+ * Syncs the redux state features/base/participants up with the redux state
|
|
|
130
|
+ * features/base/conference by ensuring that the former does not contain remote
|
|
|
131
|
+ * participants no longer relevant to the latter. Introduced to address an issue
|
|
|
132
|
+ * with multiplying thumbnails in the filmstrip.
|
|
|
133
|
+ */
|
|
|
134
|
+StateListenerRegistry.register(
|
|
|
135
|
+ /* selector */ state => {
|
|
|
136
|
+ const { conference, joining } = state['features/base/conference'];
|
|
|
137
|
+
|
|
|
138
|
+ return conference || joining;
|
|
|
139
|
+ },
|
|
|
140
|
+ /* listener */ (conference, { dispatch, getState }) => {
|
|
|
141
|
+ for (const p of getState()['features/base/participants']) {
|
|
|
142
|
+ !p.local
|
|
|
143
|
+ && (!conference || p.conference !== conference)
|
|
|
144
|
+ && dispatch(participantLeft(p.id, p.conference));
|
|
|
145
|
+ }
|
|
|
146
|
+ });
|
|
|
147
|
+
|
|
127
|
148
|
/**
|
|
128
|
149
|
* Initializes the local participant and signals that it joined.
|
|
129
|
150
|
*
|