Sfoglia il codice sorgente

[RN] Unpin participant and set last N to 1 if the filmstrip is disabled

master
Saúl Ibarra Corretgé 7 anni fa
parent
commit
417e1e83e7
1 ha cambiato i file con 21 aggiunte e 4 eliminazioni
  1. 21
    4
      react/features/filmstrip/middleware.js

+ 21
- 4
react/features/filmstrip/middleware.js Vedi File

1
-/* @flow */
1
+// @flow
2
 
2
 
3
-import { MiddlewareRegistry } from '../base/redux';
3
+import { setLastN } from '../base/conference';
4
 import { SET_CALLEE_INFO_VISIBLE } from '../base/jwt';
4
 import { SET_CALLEE_INFO_VISIBLE } from '../base/jwt';
5
+import { pinParticipant } from '../base/participants';
6
+import { MiddlewareRegistry } from '../base/redux';
5
 
7
 
6
 import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';
8
 import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';
7
 
9
 
10
+import { SET_FILMSTRIP_ENABLED } from './actionTypes';
11
+
8
 declare var APP: Object;
12
 declare var APP: Object;
9
 
13
 
10
-// eslint-disable-next-line no-unused-vars
11
-MiddlewareRegistry.register(({ getState }) => next => action => {
14
+MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
12
     switch (action.type) {
15
     switch (action.type) {
13
     case SET_CALLEE_INFO_VISIBLE:
16
     case SET_CALLEE_INFO_VISIBLE:
14
         if (typeof APP !== 'undefined') {
17
         if (typeof APP !== 'undefined') {
31
             return result;
34
             return result;
32
         }
35
         }
33
         break;
36
         break;
37
+
38
+    case SET_FILMSTRIP_ENABLED:
39
+        // FIXME: Only do this on mobile for now. The logic for participant
40
+        // pinning / unpinning is not on React yet so dispatching the action
41
+        // is not enough.
42
+        if (typeof APP === 'undefined') {
43
+            const { audioOnly } = getState()['features/base/conference'];
44
+            const { enabled } = action;
45
+
46
+            !enabled && dispatch(pinParticipant(null));
47
+            !audioOnly && dispatch(setLastN(enabled ? undefined : 1));
48
+        }
49
+        break;
50
+
34
     }
51
     }
35
 
52
 
36
     return next(action);
53
     return next(action);

Loading…
Annulla
Salva