From 343a1b87e2fea1ff0a057f37c2822e7c181e0c25 Mon Sep 17 00:00:00 2001 From: Robert Pintilii Date: Thu, 31 Mar 2022 12:13:33 +0300 Subject: [PATCH] fix(thumbnails) Fix recalculate tile dimensions on client resize (#11267) Recalculate after new dimensions are in the store Fixes issue where on participant pane toggle the tiles would not recalculate correctly --- react/features/filmstrip/middleware.web.js | 20 +------------------- react/features/filmstrip/subscriber.web.js | 9 +++++++-- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/react/features/filmstrip/middleware.web.js b/react/features/filmstrip/middleware.web.js index 661d10983..c333bfbc2 100644 --- a/react/features/filmstrip/middleware.web.js +++ b/react/features/filmstrip/middleware.web.js @@ -22,10 +22,7 @@ import { addStageParticipant, removeStageParticipant, setFilmstripWidth, - setHorizontalViewDimensions, - setStageParticipants, - setTileViewDimensions, - setVerticalViewDimensions + setStageParticipants } from './actions'; import { ACTIVE_PARTICIPANT_TIMEOUT, @@ -66,21 +63,6 @@ MiddlewareRegistry.register(store => next => action => { switch (action.type) { case CLIENT_RESIZED: { const state = store.getState(); - const layout = getCurrentLayout(state); - - switch (layout) { - case LAYOUTS.TILE_VIEW: { - store.dispatch(setTileViewDimensions()); - break; - } - case LAYOUTS.HORIZONTAL_FILMSTRIP_VIEW: - store.dispatch(setHorizontalViewDimensions()); - break; - - case LAYOUTS.VERTICAL_FILMSTRIP_VIEW: - store.dispatch(setVerticalViewDimensions()); - break; - } if (isFilmstripResizable(state)) { const { width: filmstripWidth } = state['features/filmstrip']; diff --git a/react/features/filmstrip/subscriber.web.js b/react/features/filmstrip/subscriber.web.js index dabcc144b..0e8037619 100644 --- a/react/features/filmstrip/subscriber.web.js +++ b/react/features/filmstrip/subscriber.web.js @@ -59,8 +59,11 @@ StateListenerRegistry.register( * Listens for changes in the selected layout to calculate the dimensions of the tile view grid and horizontal view. */ StateListenerRegistry.register( - /* selector */ state => getCurrentLayout(state), - /* listener */ (layout, store) => { + /* selector */ state => { + return { layout: getCurrentLayout(state), + width: state['features/base/responsive-ui'].clientWidth }; + }, + /* listener */ ({ layout }, store) => { switch (layout) { case LAYOUTS.TILE_VIEW: store.dispatch(setTileViewDimensions()); @@ -72,6 +75,8 @@ StateListenerRegistry.register( store.dispatch(setVerticalViewDimensions()); break; } + }, { + deepEquals: true }); /**