Browse Source

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 years ago
parent
commit
d7ece58c6f

+ 6
- 2
react/features/filmstrip/components/web/Toolbar.js View File

2
 
2
 
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 
4
 
5
-import { connect } from '../../../base/redux';
5
+import { connect, equals } from '../../../base/redux';
6
 import { SettingsButton } from '../../../settings';
6
 import { SettingsButton } from '../../../settings';
7
 import {
7
 import {
8
     AudioMuteButton,
8
     AudioMuteButton,
88
 function _mapStateToProps(state): Object { // eslint-disable-line no-unused-vars
88
 function _mapStateToProps(state): Object { // eslint-disable-line no-unused-vars
89
     // XXX: We are not currently using state here, but in the future, when
89
     // XXX: We are not currently using state here, but in the future, when
90
     // interfaceConfig is part of redux we will.
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
     return {
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 View File

28
     getParticipants,
28
     getParticipants,
29
     participantUpdated
29
     participantUpdated
30
 } from '../../../base/participants';
30
 } from '../../../base/participants';
31
-import { connect } from '../../../base/redux';
31
+import { connect, equals } from '../../../base/redux';
32
 import { OverflowMenuItem } from '../../../base/toolbox';
32
 import { OverflowMenuItem } from '../../../base/toolbox';
33
 import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
33
 import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
34
 import { VideoBlurButton } from '../../../blur';
34
 import { VideoBlurButton } from '../../../blur';
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
     return {
1337
     return {
1334
         _chatOpen: state['features/chat'].isOpen,
1338
         _chatOpen: state['features/chat'].isOpen,
1335
         _conference: conference,
1339
         _conference: conference,
1351
             || sharedVideoStatus === 'start'
1355
             || sharedVideoStatus === 'start'
1352
             || sharedVideoStatus === 'pause',
1356
             || sharedVideoStatus === 'pause',
1353
         _visible: isToolboxVisible(state),
1357
         _visible: isToolboxVisible(state),
1354
-        _visibleButtons: visibleButtons
1358
+        _visibleButtons: equals(visibleButtons, buttons) ? visibleButtons : buttons
1355
     };
1359
     };
1356
 }
1360
 }
1357
 
1361
 

Loading…
Cancel
Save