|
|
@@ -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
|
+});
|