Pārlūkot izejas kodu

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

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

* comment
master
virtuacoplenny 7 gadus atpakaļ
vecāks
revīzija
fe7652ec90

+ 6
- 0
react/features/video-layout/functions.js Parādīt failu

@@ -74,5 +74,11 @@ export function shouldDisplayTileView(state: Object = {}) {
74 74
         state['features/video-layout']
75 75
             && state['features/video-layout'].tileViewEnabled
76 76
             && !state['features/etherpad'].editing
77
+
78
+            // Truthy check is needed for interfaceConfig to prevent errors on
79
+            // mobile which does not have interfaceConfig. On web, tile view
80
+            // should never be enabled for filmstrip only mode.
81
+            && (typeof interfaceConfig === 'undefined'
82
+                || !interfaceConfig.filmStripOnly)
77 83
     );
78 84
 }

+ 6
- 1
react/features/video-layout/reducer.js Parādīt failu

@@ -1,10 +1,15 @@
1 1
 // @flow
2 2
 
3 3
 import { ReducerRegistry } from '../base/redux';
4
+import { PersistenceRegistry } from '../base/storage';
4 5
 
5 6
 import { SET_TILE_VIEW } from './actionTypes';
6 7
 
7
-ReducerRegistry.register('features/video-layout', (state = {}, action) => {
8
+const STORE_NAME = 'features/video-layout';
9
+
10
+PersistenceRegistry.register(STORE_NAME);
11
+
12
+ReducerRegistry.register(STORE_NAME, (state = {}, action) => {
8 13
     switch (action.type) {
9 14
     case SET_TILE_VIEW:
10 15
         return {

Notiek ielāde…
Atcelt
Saglabāt