Преглед на файлове

feat(external-api) Add participants pane toggled event (#11718)

factor2
Robert Pintilii преди 3 години
родител
ревизия
d0790736db
No account linked to committer's email address
променени са 4 файла, в които са добавени 45 реда и са изтрити 0 реда
  1. 13
    0
      modules/API/API.js
  2. 1
    0
      modules/API/external/external_api.js
  3. 1
    0
      react/features/app/middlewares.any.js
  4. 30
    0
      react/features/participants-pane/middleware.ts

+ 13
- 0
modules/API/API.js Целия файл

@@ -1695,6 +1695,19 @@ class API {
1695 1695
         });
1696 1696
     }
1697 1697
 
1698
+    /**
1699
+     * Notify the external application that the state of the participants pane changed.
1700
+     *
1701
+     * @param {boolean} open - Wether the panel is open or not.
1702
+     * @returns {void}
1703
+     */
1704
+    notifyParticipantsPaneToggled(open) {
1705
+        this._sendEvent({
1706
+            name: 'participants-pane-toggled',
1707
+            open
1708
+        });
1709
+    }
1710
+
1698 1711
     /**
1699 1712
      * Disposes the allocated resources.
1700 1713
      *

+ 1
- 0
modules/API/external/external_api.js Целия файл

@@ -126,6 +126,7 @@ const events = {
126 126
     'participant-kicked-out': 'participantKickedOut',
127 127
     'participant-left': 'participantLeft',
128 128
     'participant-role-changed': 'participantRoleChanged',
129
+    'participants-pane-toggled': 'participantsPaneToggled',
129 130
     'password-required': 'passwordRequired',
130 131
     'proxy-connection-event': 'proxyConnectionEvent',
131 132
     'raise-hand-updated': 'raiseHandUpdated',

+ 1
- 0
react/features/app/middlewares.any.js Целия файл

@@ -36,6 +36,7 @@ import '../large-video/middleware';
36 36
 import '../lobby/middleware';
37 37
 import '../notifications/middleware';
38 38
 import '../overlay/middleware';
39
+import '../participants-pane/middleware';
39 40
 import '../polls/middleware';
40 41
 import '../reactions/middleware';
41 42
 import '../recent-list/middleware';

+ 30
- 0
react/features/participants-pane/middleware.ts Целия файл

@@ -0,0 +1,30 @@
1
+// @ts-ignore
2
+import { IStore } from '../app/types';
3
+// @ts-ignore
4
+import { MiddlewareRegistry } from '../base/redux';
5
+import { PARTICIPANTS_PANE_CLOSE, PARTICIPANTS_PANE_OPEN } from './actionTypes';
6
+
7
+
8
+declare var APP: any;
9
+
10
+/**
11
+ * Middleware which intercepts participants pane actions.
12
+ *
13
+ * @param {IStore} store - The redux store.
14
+ * @returns {Function}
15
+ */
16
+MiddlewareRegistry.register((store: IStore) => (next:Function) => (action:any) => {
17
+    switch(action.type) {
18
+        case PARTICIPANTS_PANE_OPEN:
19
+            if (typeof APP !== 'undefined') {
20
+                APP.API.notifyParticipantsPaneToggled(true);
21
+            }
22
+            break;
23
+        case PARTICIPANTS_PANE_CLOSE:
24
+            if (typeof APP !== 'undefined') {
25
+                APP.API.notifyParticipantsPaneToggled(false);
26
+            }
27
+            break;
28
+    }
29
+    return next(action);
30
+});

Loading…
Отказ
Запис