|
@@ -18,7 +18,10 @@ import {
|
18
|
18
|
toggleToolbarButton
|
19
|
19
|
} from './actions.native';
|
20
|
20
|
import { SET_DEFAULT_TOOLBOX_BUTTONS } from './actionTypes';
|
21
|
|
-import { getDefaultToolboxButtons } from './functions';
|
|
21
|
+import {
|
|
22
|
+ getDefaultToolboxButtons,
|
|
23
|
+ isButtonEnabled
|
|
24
|
+} from './functions';
|
22
|
25
|
|
23
|
26
|
declare var $: Function;
|
24
|
27
|
declare var APP: Object;
|
|
@@ -37,7 +40,7 @@ export function checkAutoEnableDesktopSharing(): Function {
|
37
|
40
|
return () => {
|
38
|
41
|
// XXX Should use dispatcher to toggle screensharing but screensharing
|
39
|
42
|
// hasn't been React-ified yet.
|
40
|
|
- if (UIUtil.isButtonEnabled('desktop')
|
|
43
|
+ if (isButtonEnabled('desktop')
|
41
|
44
|
&& config.autoEnableDesktopSharing) {
|
42
|
45
|
APP.UI.eventEmitter.emit(UIEvents.TOGGLE_SCREENSHARING);
|
43
|
46
|
}
|
|
@@ -241,7 +244,7 @@ export function showDesktopSharingButton(): Function {
|
241
|
244
|
= disabledTooltipText
|
242
|
245
|
&& APP.conference.isDesktopSharingDisabledByConfig;
|
243
|
246
|
const visible
|
244
|
|
- = UIUtil.isButtonEnabled(buttonName)
|
|
247
|
+ = isButtonEnabled(buttonName)
|
245
|
248
|
&& (APP.conference.isDesktopSharingEnabled || showTooltip);
|
246
|
249
|
|
247
|
250
|
const newState = {
|
|
@@ -264,7 +267,7 @@ export function showDialPadButton(show: boolean): Function {
|
264
|
267
|
return (dispatch: Dispatch<*>) => {
|
265
|
268
|
const buttonName = 'dialpad';
|
266
|
269
|
|
267
|
|
- if (show && UIUtil.isButtonEnabled(buttonName)) {
|
|
270
|
+ if (show && isButtonEnabled(buttonName)) {
|
268
|
271
|
dispatch(setToolbarButton(buttonName, {
|
269
|
272
|
hidden: false
|
270
|
273
|
}));
|
|
@@ -296,7 +299,7 @@ export function showSharedVideoButton(): Function {
|
296
|
299
|
return (dispatch: Dispatch<*>) => {
|
297
|
300
|
const buttonName = 'sharedvideo';
|
298
|
301
|
|
299
|
|
- if (UIUtil.isButtonEnabled(buttonName)
|
|
302
|
+ if (isButtonEnabled(buttonName)
|
300
|
303
|
&& !config.disableThirdPartyRequests) {
|
301
|
304
|
dispatch(setToolbarButton(buttonName, {
|
302
|
305
|
hidden: false
|
|
@@ -318,7 +321,7 @@ export function showDialOutButton(show: boolean): Function {
|
318
|
321
|
|
319
|
322
|
if (show
|
320
|
323
|
&& APP.conference.sipGatewayEnabled()
|
321
|
|
- && UIUtil.isButtonEnabled(buttonName)
|
|
324
|
+ && isButtonEnabled(buttonName)
|
322
|
325
|
&& (!config.enableUserRolesBasedOnToken
|
323
|
326
|
|| !getState()['features/jwt'].isGuest)) {
|
324
|
327
|
dispatch(setToolbarButton(buttonName, {
|
|
@@ -372,10 +375,9 @@ export function toggleSideToolbarContainer(containerId: string): Function {
|
372
|
375
|
const { secondaryToolbarButtons } = getState()['features/toolbox'];
|
373
|
376
|
|
374
|
377
|
for (const key of secondaryToolbarButtons.keys()) {
|
375
|
|
- const isButtonEnabled = UIUtil.isButtonEnabled(key);
|
376
|
378
|
const button = secondaryToolbarButtons.get(key);
|
377
|
379
|
|
378
|
|
- if (isButtonEnabled
|
|
380
|
+ if (isButtonEnabled(key)
|
379
|
381
|
&& button.sideContainerId
|
380
|
382
|
&& button.sideContainerId === containerId) {
|
381
|
383
|
dispatch(toggleToolbarButton(key));
|