feat(tile-view): persist setting in local storage (#3379)

* feat(tile-view): persist setting in local storage

* comment
This commit is contained in:
virtuacoplenny 2018-08-31 08:36:01 -07:00 committed by yanas
parent 72776e3a23
commit fe7652ec90
2 changed files with 12 additions and 1 deletions

View File

@ -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)
);
}

View File

@ -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 {