Bläddra i källkod

fix(optimise): cope with URL interface config overrides

Regresssion from bd8a7edbd2.

When the toolbar buttons are overridden with URL parameters, our computed set of
buttons will be wrong. Thus, compute it every time and check for the
differences.
master
Saúl Ibarra Corretgé 5 år sedan
förälder
incheckning
d7ece58c6f

+ 6
- 2
react/features/filmstrip/components/web/Toolbar.js Visa fil

@@ -2,7 +2,7 @@
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 
5
-import { connect } from '../../../base/redux';
5
+import { connect, equals } from '../../../base/redux';
6 6
 import { SettingsButton } from '../../../settings';
7 7
 import {
8 8
     AudioMuteButton,
@@ -88,9 +88,13 @@ class Toolbar extends Component<Props> {
88 88
 function _mapStateToProps(state): Object { // eslint-disable-line no-unused-vars
89 89
     // XXX: We are not currently using state here, but in the future, when
90 90
     // interfaceConfig is part of redux we will.
91
+    //
92
+    // NB: We compute the buttons again here because if URL parameters were used to
93
+    // override them we'd miss it.
94
+    const buttons = new Set(interfaceConfig.TOOLBAR_BUTTONS);
91 95
 
92 96
     return {
93
-        _visibleButtons: visibleButtons
97
+        _visibleButtons: equals(visibleButtons, buttons) ? visibleButtons : buttons
94 98
     };
95 99
 }
96 100
 

+ 6
- 2
react/features/toolbox/components/web/Toolbox.js Visa fil

@@ -28,7 +28,7 @@ import {
28 28
     getParticipants,
29 29
     participantUpdated
30 30
 } from '../../../base/participants';
31
-import { connect } from '../../../base/redux';
31
+import { connect, equals } from '../../../base/redux';
32 32
 import { OverflowMenuItem } from '../../../base/toolbox';
33 33
 import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
34 34
 import { VideoBlurButton } from '../../../blur';
@@ -1330,6 +1330,10 @@ function _mapStateToProps(state) {
1330 1330
         }
1331 1331
     }
1332 1332
 
1333
+    // NB: We compute the buttons again here because if URL parameters were used to
1334
+    // override them we'd miss it.
1335
+    const buttons = new Set(interfaceConfig.TOOLBAR_BUTTONS);
1336
+
1333 1337
     return {
1334 1338
         _chatOpen: state['features/chat'].isOpen,
1335 1339
         _conference: conference,
@@ -1351,7 +1355,7 @@ function _mapStateToProps(state) {
1351 1355
             || sharedVideoStatus === 'start'
1352 1356
             || sharedVideoStatus === 'pause',
1353 1357
         _visible: isToolboxVisible(state),
1354
-        _visibleButtons: visibleButtons
1358
+        _visibleButtons: equals(visibleButtons, buttons) ? visibleButtons : buttons
1355 1359
     };
1356 1360
 }
1357 1361
 

Laddar…
Avbryt
Spara