Coding style: formatting, comments

This commit is contained in:
Lyubo Marinov 2018-05-18 08:19:25 -05:00
parent 5bd975e3f3
commit 21c1e4abc4
2 changed files with 16 additions and 18 deletions

View File

@ -61,7 +61,7 @@ type Props = {
_onHardwareBackPress: Function, _onHardwareBackPress: Function,
/** /**
* Number of participants in the conference. * The number of participants in the conference.
* *
* @private * @private
*/ */
@ -129,12 +129,10 @@ class Conference extends Component<Props> {
this._onHardwareBackPress); this._onHardwareBackPress);
} }
// Show the toolbar if we are the only participant. // Show the toolbox if we are the only participant.
const { _participantCount, _setToolboxVisible } = this.props; const { _participantCount, _setToolboxVisible } = this.props;
if (_participantCount === 1) { _participantCount === 1 && _setToolboxVisible(true);
_setToolboxVisible(true);
}
} }
/** /**
@ -159,14 +157,16 @@ class Conference extends Component<Props> {
* that this instance will receive. * that this instance will receive.
* @returns {void} * @returns {void}
*/ */
componentWillReceiveProps(nextProps) { componentWillReceiveProps({ _participantCount: newParticipantCount }) {
const oldParticipantCount = this.props._participantCount; const {
const newParticipantCount = nextProps._participantCount; _participantCount: oldParticipantCount,
_setToolboxVisible
} = this.props;
if (oldParticipantCount === 1 && newParticipantCount > 1) { if (oldParticipantCount === 1) {
this.props._setToolboxVisible(false); newParticipantCount > 1 && _setToolboxVisible(false);
} else if (oldParticipantCount > 1 && newParticipantCount === 1) { } else if (oldParticipantCount > 1) {
this.props._setToolboxVisible(true); newParticipantCount === 1 && _setToolboxVisible(true);
} }
} }
@ -373,6 +373,7 @@ function _mapDispatchToProps(dispatch) {
* @private * @private
* @returns {{ * @returns {{
* _connecting: boolean, * _connecting: boolean,
* _participantCount: number,
* _reducedUI: boolean, * _reducedUI: boolean,
* _toolboxVisible: boolean * _toolboxVisible: boolean
* }} * }}
@ -408,7 +409,7 @@ function _mapStateToProps(state) {
_connecting: Boolean(connecting_), _connecting: Boolean(connecting_),
/** /**
* Number of participants in the conference. * The number of participants in the conference.
* *
* @private * @private
* @type {number} * @type {number}

View File

@ -1,6 +1,6 @@
// @flow // @flow
import { ReducerRegistry } from '../base/redux'; import { ReducerRegistry, set } from '../base/redux';
import { import {
CLEAR_TOOLBOX_TIMEOUT, CLEAR_TOOLBOX_TIMEOUT,
@ -149,10 +149,7 @@ ReducerRegistry.register(
}; };
case SET_TOOLBOX_VISIBLE: case SET_TOOLBOX_VISIBLE:
return { return set(state, 'visible', action.visible);
...state,
visible: action.visible
};
} }
return state; return state;