From 14adc0b887c2d7465a2209178b3ca94c680126b8 Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Mon, 29 Oct 2018 11:48:18 -0700 Subject: [PATCH] ref(always-on-top): trigger toolbar hide timeout after update --- react/features/always-on-top/AlwaysOnTop.js | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/react/features/always-on-top/AlwaysOnTop.js b/react/features/always-on-top/AlwaysOnTop.js index 7e66009fe..dffccbcf9 100644 --- a/react/features/always-on-top/AlwaysOnTop.js +++ b/react/features/always-on-top/AlwaysOnTop.js @@ -205,6 +205,18 @@ export default class AlwaysOnTop extends Component<*, State> { this._hideToolbarAfterTimeout(); } + /** + * Sets a timeout to hide the toolbar when the toolbar is shown. + * + * @inheritdoc + * @returns {void} + */ + componentDidUpdate(prevProps: *, prevState: State) { + if (!prevState.visible && this.state.visible) { + this._hideToolbarAfterTimeout(); + } + } + /** * Removes all listeners. * @@ -223,18 +235,6 @@ export default class AlwaysOnTop extends Component<*, State> { window.removeEventListener('mousemove', this._mouseMove); } - /** - * Sets a timeout to hide the toolbar when the toolbar is shown. - * - * @inheritdoc - * @returns {void} - */ - componentWillUpdate(nextProps: *, nextState: State) { - if (!this.state.visible && nextState.visible) { - this._hideToolbarAfterTimeout(); - } - } - /** * Implements React's {@link Component#render()}. *