diff --git a/flow-typed/npm/redux_v3.x.x.js b/flow-typed/npm/redux_v3.x.x.js index b37dd7056..d2dece6e2 100644 --- a/flow-typed/npm/redux_v3.x.x.js +++ b/flow-typed/npm/redux_v3.x.x.js @@ -54,9 +54,4 @@ declare module 'redux' { declare function combineReducers(reducers: O): CombinedReducer<$ObjMap(r: Reducer) => S>, A>; declare function compose(...fns: Array>): Function; - - // Utility function in Redux that can be used for function composition - // e.g. bar(foo(baz)) is equivalent to compose(bar, foo)(baz). - declare function compose(...fns: Array): Function; - } diff --git a/react/features/toolbox/actions.web.js b/react/features/toolbox/actions.web.js index 26599a92d..8ae4aca41 100644 --- a/react/features/toolbox/actions.web.js +++ b/react/features/toolbox/actions.web.js @@ -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);