From 1d34a50d2fa466529e9e8afe1ab17b23f7bf99c0 Mon Sep 17 00:00:00 2001 From: yanas Date: Fri, 26 May 2017 16:28:16 -0500 Subject: [PATCH] Fix raise hand toggled state --- react/features/toolbox/actions.native.js | 5 ++--- react/features/toolbox/functions.native.js | 15 +++++++++++++++ react/features/toolbox/functions.web.js | 15 --------------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/react/features/toolbox/actions.native.js b/react/features/toolbox/actions.native.js index c93ad18c0..168dca127 100644 --- a/react/features/toolbox/actions.native.js +++ b/react/features/toolbox/actions.native.js @@ -17,10 +17,9 @@ import { /** * FIXME: We should make sure all common functions for native and web are - * separated in a global functions file, as well as all actions! Currently this - * file contains actions that are imported in actions.web. + * merged in a global functions file. */ -import { getButton } from './functions.web'; +import { getButton } from './functions.native'; /** * Event handler for local raise hand changed event. diff --git a/react/features/toolbox/functions.native.js b/react/features/toolbox/functions.native.js index 70277956a..ec4ce6b50 100644 --- a/react/features/toolbox/functions.native.js +++ b/react/features/toolbox/functions.native.js @@ -100,3 +100,18 @@ export function abstractMapStateToProps(state: Object): Object { _visible: visible }; } + +/** + * Returns the button object corresponding to the given buttonName. + * + * @param {string} buttonName - The name of the button. + * @param {Object} state - The current state. + * @returns {Object} - The button object. + */ +export function getButton(buttonName: string, state: Object) { + const { primaryToolbarButtons, secondaryToolbarButtons } + = state['features/toolbox']; + + return primaryToolbarButtons.get(buttonName) + || secondaryToolbarButtons.get(buttonName); +} diff --git a/react/features/toolbox/functions.web.js b/react/features/toolbox/functions.web.js index 660792ff3..56cd3f8ed 100644 --- a/react/features/toolbox/functions.web.js +++ b/react/features/toolbox/functions.web.js @@ -13,21 +13,6 @@ export { abstractMapStateToProps } from './functions.native'; /* eslint-disable flowtype/space-before-type-colon */ -/** - * Returns the button object corresponding to the given buttonName. - * - * @param {string} buttonName - The name of the button. - * @param {Object} state - The current state. - * @returns {Object} - The button object. - */ -export function getButton(buttonName: string, state: Object) { - const { primaryToolbarButtons, secondaryToolbarButtons } - = state['features/toolbox']; - - return primaryToolbarButtons.get(buttonName) - || secondaryToolbarButtons.get(buttonName); -} - /** * Takes toolbar button props and maps them to HTML attributes to set. *