mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
Instead of assuming the initial info dialog open should auto close, explicitly call opening of the dialog with a flag for auto closing. This better facilitates the auto close timeout being set at any time. The changes led to refactoring out state in the InfoDialogButton in preference for always clearing the timeout instead of first checking for interaction before clearing.
33 lines
893 B
JavaScript
33 lines
893 B
JavaScript
import { CONFERENCE_JOINED } from '../base/conference';
|
|
import { MiddlewareRegistry } from '../base/redux';
|
|
|
|
import { setInfoDialogVisibility } from './actions';
|
|
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) {
|
|
case CONFERENCE_JOINED:
|
|
store.dispatch(setInfoDialogVisibility(true, true));
|
|
break;
|
|
|
|
case UPDATE_DIAL_IN_NUMBERS_FAILED:
|
|
logger.error(
|
|
'Error encountered while fetching dial-in numbers:',
|
|
action.error);
|
|
break;
|
|
}
|
|
|
|
return result;
|
|
});
|