Fix raise hand toggled state

This commit is contained in:
yanas 2017-05-26 16:28:16 -05:00 committed by Дамян Минков
parent d1737745c2
commit 1d34a50d2f
3 changed files with 17 additions and 18 deletions

View File

@ -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.

View File

@ -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);
}

View File

@ -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.
*