Fix(React/conference): Sets an initial toolbar view timeout

This commit is contained in:
yanas 2017-01-03 14:53:52 -06:00
parent c46772015b
commit 930e65da66
1 changed files with 18 additions and 5 deletions

View File

@ -102,6 +102,8 @@ class Conference extends Component {
render() {
const toolbarVisible = this.state.toolbarVisible;
this._setToolbarTimeout(toolbarVisible);
return (
<Container
onClick = { this._onClick }
@ -145,11 +147,7 @@ class Conference extends Component {
this.setState({ toolbarVisible });
this._clearToolbarTimeout();
if (toolbarVisible) {
this._toolbarTimeout
= setTimeout(this._onClick, TOOLBAR_TIMEOUT_MS);
}
this._setToolbarTimeout(toolbarVisible);
}
/**
@ -201,6 +199,21 @@ class Conference extends Component {
return null;
}
/**
* Triggers the default toolbar timeout.
*
* @param {boolean} toolbarVisible - indicates if the toolbar is currently
* visible
* @private
*/
_setToolbarTimeout(toolbarVisible) {
this._clearToolbarTimeout();
if (toolbarVisible) {
this._toolbarTimeout
= setTimeout(this._onClick, TOOLBAR_TIMEOUT_MS);
}
}
}
/**