Procházet zdrojové kódy

ref(api): move feedbackSubmitted notification to api middleware

master
Leonard Kim před 6 roky
rodič
revize
a1db63a8c2

+ 5
- 0
react/features/external-api/middleware.js Zobrazit soubor

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

+ 0
- 1
react/features/feedback/index.js Zobrazit soubor

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

+ 0
- 26
react/features/feedback/middleware.js Zobrazit soubor

@@ -1,26 +0,0 @@
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
-});

Načítá se…
Zrušit
Uložit