From 7a479b967ca35c953dbed1bf5766896811c30dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 1 Dec 2021 14:04:13 +0100 Subject: [PATCH] fix(modal) remove dead code --- react/features/app/reducers.any.js | 1 - react/features/base/modal/actionTypes.js | 6 ------ react/features/base/modal/actions.js | 21 --------------------- react/features/base/modal/index.js | 4 ---- react/features/base/modal/reducer.js | 18 ------------------ react/features/conference/middleware.js | 4 ---- react/features/etherpad/middleware.js | 16 ++-------------- 7 files changed, 2 insertions(+), 68 deletions(-) delete mode 100644 react/features/base/modal/actionTypes.js delete mode 100644 react/features/base/modal/actions.js delete mode 100644 react/features/base/modal/index.js delete mode 100644 react/features/base/modal/reducer.js diff --git a/react/features/app/reducers.any.js b/react/features/app/reducers.any.js index 3ff472498..88970cb2a 100644 --- a/react/features/app/reducers.any.js +++ b/react/features/app/reducers.any.js @@ -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'; diff --git a/react/features/base/modal/actionTypes.js b/react/features/base/modal/actionTypes.js deleted file mode 100644 index 90fb8901f..000000000 --- a/react/features/base/modal/actionTypes.js +++ /dev/null @@ -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'; diff --git a/react/features/base/modal/actions.js b/react/features/base/modal/actions.js deleted file mode 100644 index 90c985d32..000000000 --- a/react/features/base/modal/actions.js +++ /dev/null @@ -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 - }; -} diff --git a/react/features/base/modal/index.js b/react/features/base/modal/index.js deleted file mode 100644 index 3d915f1aa..000000000 --- a/react/features/base/modal/index.js +++ /dev/null @@ -1,4 +0,0 @@ -// @flow - -export * from './actions'; -export * from './actionTypes'; diff --git a/react/features/base/modal/reducer.js b/react/features/base/modal/reducer.js deleted file mode 100644 index 8059553ec..000000000 --- a/react/features/base/modal/reducer.js +++ /dev/null @@ -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; -}); diff --git a/react/features/conference/middleware.js b/react/features/conference/middleware.js index 4b3f85428..77711cb36 100644 --- a/react/features/conference/middleware.js +++ b/react/features/conference/middleware.js @@ -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()); } }); diff --git a/react/features/etherpad/middleware.js b/react/features/etherpad/middleware.js index 501c8889e..12a71b141 100644 --- a/react/features/etherpad/middleware.js +++ b/react/features/etherpad/middleware.js @@ -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;