From fe7652ec90b20b7482150c64d00c05e101a6cada Mon Sep 17 00:00:00 2001 From: virtuacoplenny Date: Fri, 31 Aug 2018 08:36:01 -0700 Subject: [PATCH] feat(tile-view): persist setting in local storage (#3379) * feat(tile-view): persist setting in local storage * comment --- react/features/video-layout/functions.js | 6 ++++++ react/features/video-layout/reducer.js | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/react/features/video-layout/functions.js b/react/features/video-layout/functions.js index 31cdf97eda..42f93856f4 100644 --- a/react/features/video-layout/functions.js +++ b/react/features/video-layout/functions.js @@ -74,5 +74,11 @@ export function shouldDisplayTileView(state: Object = {}) { state['features/video-layout'] && state['features/video-layout'].tileViewEnabled && !state['features/etherpad'].editing + + // Truthy check is needed for interfaceConfig to prevent errors on + // mobile which does not have interfaceConfig. On web, tile view + // should never be enabled for filmstrip only mode. + && (typeof interfaceConfig === 'undefined' + || !interfaceConfig.filmStripOnly) ); } diff --git a/react/features/video-layout/reducer.js b/react/features/video-layout/reducer.js index dc99f4018e..699320c069 100644 --- a/react/features/video-layout/reducer.js +++ b/react/features/video-layout/reducer.js @@ -1,10 +1,15 @@ // @flow import { ReducerRegistry } from '../base/redux'; +import { PersistenceRegistry } from '../base/storage'; import { SET_TILE_VIEW } from './actionTypes'; -ReducerRegistry.register('features/video-layout', (state = {}, action) => { +const STORE_NAME = 'features/video-layout'; + +PersistenceRegistry.register(STORE_NAME); + +ReducerRegistry.register(STORE_NAME, (state = {}, action) => { switch (action.type) { case SET_TILE_VIEW: return {