2017-10-10 22:47:29 -07:00
|
|
|
import { CONFERENCE_JOINED } from '../base/conference';
|
2017-05-19 15:35:10 -07:00
|
|
|
import { MiddlewareRegistry } from '../base/redux';
|
|
|
|
|
|
2017-10-10 22:47:29 -07:00
|
|
|
import { setInfoDialogVisibility } from './actions';
|
2017-05-19 15:35:10 -07:00
|
|
|
import { UPDATE_DIAL_IN_NUMBERS_FAILED } from './actionTypes';
|
|
|
|
|
|
|
|
|
|
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Middleware that catches actions fetching dial-in numbers.
|
|
|
|
|
*
|
|
|
|
|
* @param {Store} store - Redux store.
|
|
|
|
|
* @returns {Function}
|
|
|
|
|
*/
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
MiddlewareRegistry.register(store => next => action => {
|
|
|
|
|
const result = next(action);
|
|
|
|
|
|
|
|
|
|
switch (action.type) {
|
2017-10-10 22:47:29 -07:00
|
|
|
case CONFERENCE_JOINED:
|
2017-11-10 13:43:40 -06:00
|
|
|
// we do not want to show call info in iAmRecorder mode
|
|
|
|
|
if (store.getState()['features/base/config'].iAmRecorder) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2017-10-11 10:27:56 -07:00
|
|
|
store.dispatch(setInfoDialogVisibility(true, true));
|
2017-10-10 22:47:29 -07:00
|
|
|
break;
|
|
|
|
|
|
2017-05-19 15:35:10 -07:00
|
|
|
case UPDATE_DIAL_IN_NUMBERS_FAILED:
|
2017-06-14 19:40:51 -05:00
|
|
|
logger.error(
|
|
|
|
|
'Error encountered while fetching dial-in numbers:',
|
|
|
|
|
action.error);
|
2017-05-19 15:35:10 -07:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
});
|