fix(modal) remove dead code

This commit is contained in:
Saúl Ibarra Corretgé 2021-12-01 14:04:13 +01:00 committed by Saúl Ibarra Corretgé
parent 0be0d6a76e
commit 7a479b967c
7 changed files with 2 additions and 68 deletions

View File

@ -16,7 +16,6 @@ import '../base/lastn/reducer';
import '../base/lib-jitsi-meet/reducer';
import '../base/logging/reducer';
import '../base/media/reducer';
import '../base/modal/reducer';
import '../base/net-info/reducer';
import '../base/participants/reducer';
import '../base/responsive-ui/reducer';

View File

@ -1,6 +0,0 @@
// @flow
/**
* Action type to set the ID of the active modal (or undefined if needs to be hidden).
*/
export const SET_ACTIVE_MODAL_ID = 'SET_ACTIVE_MODAL_ID';

View File

@ -1,21 +0,0 @@
// @flow
import { SET_ACTIVE_MODAL_ID } from './actionTypes';
/**
* Action to set the ID of the active modal (or undefined if needs to be hidden).
*
* @param {string} activeModalId - The new modal ID or undefined.
* @param {Object} modalProps - The props to pass to the modal.
* @returns {{
* activeModalId: string,
* type: SET_ACTIVE_MODAL_ID
* }}
*/
export function setActiveModalId(activeModalId: ?string, modalProps: Object = {}) {
return {
activeModalId,
modalProps,
type: SET_ACTIVE_MODAL_ID
};
}

View File

@ -1,4 +0,0 @@
// @flow
export * from './actions';
export * from './actionTypes';

View File

@ -1,18 +0,0 @@
// @flow
import { ReducerRegistry } from '../redux';
import { SET_ACTIVE_MODAL_ID } from './actionTypes';
ReducerRegistry.register('features/base/modal', (state = {}, action) => {
switch (action.type) {
case SET_ACTIVE_MODAL_ID:
return {
...state,
activeModalId: action.activeModalId,
modalProps: action.modalProps
};
}
return state;
});

View File

@ -7,7 +7,6 @@ import {
getCurrentConference
} from '../base/conference';
import { hideDialog, isDialogOpen } from '../base/dialog';
import { setActiveModalId } from '../base/modal';
import { pinParticipant } from '../base/participants';
import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
import { SET_REDUCED_UI } from '../base/responsive-ui';
@ -79,8 +78,5 @@ StateListenerRegistry.register(
// dialog we might have open.
dispatch(hideDialog());
}
// We want to close all modals.
dispatch(setActiveModalId());
}
});

View File

@ -2,12 +2,10 @@
import UIEvents from '../../../service/UI/UIEvents';
import { getCurrentConference } from '../base/conference';
import { setActiveModalId } from '../base/modal';
import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
import { TOGGLE_DOCUMENT_EDITING } from './actionTypes';
import { setDocumentEditingState, setDocumentUrl } from './actions';
import { SHARE_DOCUMENT_VIEW_ID } from './constants';
import { setDocumentUrl } from './actions';
declare var APP: Object;
@ -24,17 +22,7 @@ const ETHERPAD_COMMAND = 'etherpad';
MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
switch (action.type) {
case TOGGLE_DOCUMENT_EDITING: {
if (typeof APP === 'undefined') {
const editing = !getState()['features/etherpad'].editing;
dispatch(setDocumentEditingState(editing));
if (editing) {
dispatch(setActiveModalId(SHARE_DOCUMENT_VIEW_ID));
} else if (getState()['features/base/modal'].activeModalId === SHARE_DOCUMENT_VIEW_ID) {
dispatch(setActiveModalId(undefined));
}
} else {
if (typeof APP !== 'undefined') {
APP.UI.emitEvent(UIEvents.ETHERPAD_CLICKED);
}
break;