Pārlūkot izejas kodu

ref(api): move feedbackSubmitted notification to api middleware

master
Leonard Kim 6 gadus atpakaļ
vecāks
revīzija
a1db63a8c2

+ 5
- 0
react/features/external-api/middleware.js Parādīt failu

4
 import { NOTIFY_CAMERA_ERROR, NOTIFY_MIC_ERROR } from '../base/devices';
4
 import { NOTIFY_CAMERA_ERROR, NOTIFY_MIC_ERROR } from '../base/devices';
5
 import { JitsiConferenceErrors } from '../base/lib-jitsi-meet';
5
 import { JitsiConferenceErrors } from '../base/lib-jitsi-meet';
6
 import { MiddlewareRegistry } from '../base/redux';
6
 import { MiddlewareRegistry } from '../base/redux';
7
+import { SUBMIT_FEEDBACK } from '../feedback';
7
 
8
 
8
 declare var APP: Object;
9
 declare var APP: Object;
9
 
10
 
34
             APP.API.notifyOnMicError(action.error.name, action.error.message);
35
             APP.API.notifyOnMicError(action.error.name, action.error.message);
35
         }
36
         }
36
         break;
37
         break;
38
+
39
+    case SUBMIT_FEEDBACK:
40
+        APP.API.notifyFeedbackSubmitted();
41
+        break;
37
     }
42
     }
38
 
43
 
39
     return next(action);
44
     return next(action);

+ 0
- 1
react/features/feedback/index.js Parādīt failu

2
 export * from './actionTypes';
2
 export * from './actionTypes';
3
 export * from './components';
3
 export * from './components';
4
 
4
 
5
-import './middleware';
6
 import './reducer';
5
 import './reducer';

+ 0
- 26
react/features/feedback/middleware.js Parādīt failu

1
-/* @flow */
2
-
3
-import { MiddlewareRegistry } from '../base/redux';
4
-
5
-import { SUBMIT_FEEDBACK } from './actionTypes';
6
-
7
-declare var APP: Object;
8
-
9
-/**
10
- * Implements the middleware of the feature feedback.
11
- *
12
- * @param {Store} store - The redux store.
13
- * @returns {Function}
14
- */
15
-// eslint-disable-next-line no-unused-vars
16
-MiddlewareRegistry.register(store => next => action => {
17
-    switch (action.type) {
18
-    case SUBMIT_FEEDBACK:
19
-        if (typeof APP === 'object') {
20
-            APP.API.notifyFeedbackSubmitted();
21
-        }
22
-        break;
23
-    }
24
-
25
-    return next(action);
26
-});

Notiek ielāde…
Atcelt
Saglabāt