|
|
|
@ -1,12 +1,10 @@ |
|
|
|
|
/* @flow */ |
|
|
|
|
|
|
|
|
|
import { compose } from 'redux'; |
|
|
|
|
|
|
|
|
|
import Recording from '../../../modules/UI/recording/Recording'; |
|
|
|
|
import SideContainerToggler |
|
|
|
|
from '../../../modules/UI/side_pannels/SideContainerToggler'; |
|
|
|
|
import UIEvents from '../../../service/UI/UIEvents'; |
|
|
|
|
import UIUtil from '../../../modules/UI/util/UIUtil'; |
|
|
|
|
import UIEvents from '../../../service/UI/UIEvents'; |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
changeLocalRaiseHand, |
|
|
|
@ -19,7 +17,6 @@ import { |
|
|
|
|
toggleFullScreen, |
|
|
|
|
toggleToolbarButton |
|
|
|
|
} from './actions.native'; |
|
|
|
|
|
|
|
|
|
import { SET_DEFAULT_TOOLBOX_BUTTONS } from './actionTypes'; |
|
|
|
|
import { getDefaultToolboxButtons } from './functions'; |
|
|
|
|
|
|
|
|
@ -40,7 +37,6 @@ export function checkAutoEnableDesktopSharing(): Function { |
|
|
|
|
return () => { |
|
|
|
|
// XXX Should use dispatcher to toggle screensharing but screensharing
|
|
|
|
|
// hasn't been React-ified yet.
|
|
|
|
|
|
|
|
|
|
if (UIUtil.isButtonEnabled('desktop') |
|
|
|
|
&& config.autoEnableDesktopSharing) { |
|
|
|
|
APP.UI.eventEmitter.emit(UIEvents.TOGGLE_SCREENSHARING); |
|
|
|
@ -60,8 +56,7 @@ export function dockToolbox(dock: boolean): Function { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const state = getState(); |
|
|
|
|
const { timeoutMS, visible } = state['features/toolbox']; |
|
|
|
|
const { timeoutMS, visible } = getState()['features/toolbox']; |
|
|
|
|
|
|
|
|
|
if (dock) { |
|
|
|
|
// First make sure the toolbox is shown.
|
|
|
|
@ -89,10 +84,10 @@ export function dockToolbox(dock: boolean): Function { |
|
|
|
|
* @private |
|
|
|
|
*/ |
|
|
|
|
function _getButtonHandlers(dispatch, getState) { |
|
|
|
|
const { isGuest } = getState()['features/jwt']; |
|
|
|
|
|
|
|
|
|
const localRaiseHandHandler = compose(dispatch, changeLocalRaiseHand); |
|
|
|
|
const toggleFullScreenHandler = compose(dispatch, toggleFullScreen); |
|
|
|
|
const localRaiseHandHandler |
|
|
|
|
= (...args) => dispatch(changeLocalRaiseHand(...args)); |
|
|
|
|
const toggleFullScreenHandler |
|
|
|
|
= (...args) => dispatch(toggleFullScreen(...args)); |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
/** |
|
|
|
@ -127,8 +122,8 @@ function _getButtonHandlers(dispatch, getState) { |
|
|
|
|
*/ |
|
|
|
|
profile: { |
|
|
|
|
onMount: () => |
|
|
|
|
isGuest |
|
|
|
|
|| dispatch(setProfileButtonUnclickable(true)) |
|
|
|
|
getState()['features/jwt'] |
|
|
|
|
|| dispatch(setProfileButtonUnclickable(true)) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -154,8 +149,7 @@ function _getButtonHandlers(dispatch, getState) { |
|
|
|
|
*/ |
|
|
|
|
recording: { |
|
|
|
|
onMount: () => |
|
|
|
|
config.enableRecording |
|
|
|
|
&& dispatch(showRecordingButton()) |
|
|
|
|
config.enableRecording && dispatch(showRecordingButton()) |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
@ -366,8 +360,7 @@ export function showToolbox(timeout: number = 0): Object { |
|
|
|
|
*/ |
|
|
|
|
export function toggleSideToolbarContainer(containerId: string): Function { |
|
|
|
|
return (dispatch: Dispatch, getState: Function) => { |
|
|
|
|
const state = getState(); |
|
|
|
|
const { secondaryToolbarButtons } = state['features/toolbox']; |
|
|
|
|
const { secondaryToolbarButtons } = getState()['features/toolbox']; |
|
|
|
|
|
|
|
|
|
for (const key of secondaryToolbarButtons.keys()) { |
|
|
|
|
const isButtonEnabled = UIUtil.isButtonEnabled(key); |
|
|
|
|