From 1396d59ce20e296abe77f7fec7ed05bf862ce75e Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Wed, 28 Nov 2018 11:48:15 -0800 Subject: [PATCH] fix(tile-view): disable on etherpad display, disable etherpad on view enter --- react/features/video-layout/middleware.any.js | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/react/features/video-layout/middleware.any.js b/react/features/video-layout/middleware.any.js index 5c6689b96..2f3675f42 100644 --- a/react/features/video-layout/middleware.any.js +++ b/react/features/video-layout/middleware.any.js @@ -4,6 +4,7 @@ import { pinParticipant } from '../base/participants'; import { MiddlewareRegistry } from '../base/redux'; +import { SET_DOCUMENT_EDITING_STATUS, toggleDocument } from '../etherpad'; import { SET_TILE_VIEW } from './actionTypes'; import { setTileView } from './actions'; @@ -27,13 +28,29 @@ MiddlewareRegistry.register(store => next => action => { break; } - case SET_TILE_VIEW: - if (getPinnedParticipant(store.getState()) && action.enabled) { - store.dispatch(pinParticipant(null)); + case SET_DOCUMENT_EDITING_STATUS: + if (action.editing) { + store.dispatch(setTileView(false)); + } + + break; + + case SET_TILE_VIEW: { + const state = store.getState(); + + if (action.enabled) { + if (getPinnedParticipant(state)) { + store.dispatch(pinParticipant(null)); + } + + if (state['features/etherpad'].editing) { + store.dispatch(toggleDocument()); + } } break; } + } return next(action); });