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() { render() {
const toolbarVisible = this.state.toolbarVisible; const toolbarVisible = this.state.toolbarVisible;
this._setToolbarTimeout(toolbarVisible);
return ( return (
<Container <Container
onClick = { this._onClick } onClick = { this._onClick }
@ -145,11 +147,7 @@ class Conference extends Component {
this.setState({ toolbarVisible }); this.setState({ toolbarVisible });
this._clearToolbarTimeout(); this._setToolbarTimeout(toolbarVisible);
if (toolbarVisible) {
this._toolbarTimeout
= setTimeout(this._onClick, TOOLBAR_TIMEOUT_MS);
}
} }
/** /**
@ -201,6 +199,21 @@ class Conference extends Component {
return null; 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);
}
}
} }
/** /**