Spot will need a way to submit call feedback using the iframe api. For now expose a method on conference.js to submit that feedback. Exposing on conference.js looks to be the existing pattern... Also add an event to notify consumers of the iframe api that feedback was submitted, as postMessage is async and the notification can at least give some guarantee maybe. I haven't updated documentation yet as I'm not confident about this api.
27 lines
573 B
JavaScript
27 lines
573 B
JavaScript
/* @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);
|
|
});
|