Merge branch 'fix-mobile-toolbar-initial-timeout'

This commit is contained in:
Lyubomir Marinov 2017-01-03 15:27:22 -06:00
commit fd6c91715f
1 changed files with 27 additions and 5 deletions

View File

@ -70,6 +70,16 @@ class Conference extends Component {
this._onClick = this._onClick.bind(this);
}
/**
* Inits the toolbar timeout after the component is initially rendered.
*
* @inheritdoc
* returns {void}
*/
componentDidMount() {
this._setToolbarTimeout(this.state.toolbarVisible);
}
/**
* Inits new connection and conference when conference screen is entered.
*
@ -145,11 +155,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 +207,22 @@ class Conference extends Component {
return null;
}
/**
* Triggers the default toolbar timeout.
*
* @param {boolean} toolbarVisible - Indicates if the toolbar is currently
* visible.
* @private
* @returns {void}
*/
_setToolbarTimeout(toolbarVisible) {
this._clearToolbarTimeout();
if (toolbarVisible) {
this._toolbarTimeout
= setTimeout(this._onClick, TOOLBAR_TIMEOUT_MS);
}
}
}
/**