ref(api): move feedbackSubmitted notification to api middleware

pull/4366/head
Leonard Kim 6 years ago committed by virtuacoplenny
parent 59a9c2d947
commit a1db63a8c2
  1. 5
      react/features/external-api/middleware.js
  2. 1
      react/features/feedback/index.js
  3. 26
      react/features/feedback/middleware.js

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

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

@ -1,26 +0,0 @@
/* @flow */
import { MiddlewareRegistry } from '../base/redux';
import { SUBMIT_FEEDBACK } from './actionTypes';
declare var APP: Object;
/**
* Implements the middleware of the feature feedback.
*
* @param {Store} store - The redux store.
* @returns {Function}
*/
// eslint-disable-next-line no-unused-vars
MiddlewareRegistry.register(store => next => action => {
switch (action.type) {
case SUBMIT_FEEDBACK:
if (typeof APP === 'object') {
APP.API.notifyFeedbackSubmitted();
}
break;
}
return next(action);
});
Loading…
Cancel
Save