Przeglądaj źródła

ref(always-on-top): trigger toolbar hide timeout after update

j8
Leonard Kim 7 lat temu
rodzic
commit
14adc0b887
1 zmienionych plików z 12 dodań i 12 usunięć
  1. 12
    12
      react/features/always-on-top/AlwaysOnTop.js

+ 12
- 12
react/features/always-on-top/AlwaysOnTop.js Wyświetl plik

@@ -205,6 +205,18 @@ export default class AlwaysOnTop extends Component<*, State> {
205 205
         this._hideToolbarAfterTimeout();
206 206
     }
207 207
 
208
+    /**
209
+     * Sets a timeout to hide the toolbar when the toolbar is shown.
210
+     *
211
+     * @inheritdoc
212
+     * @returns {void}
213
+     */
214
+    componentDidUpdate(prevProps: *, prevState: State) {
215
+        if (!prevState.visible && this.state.visible) {
216
+            this._hideToolbarAfterTimeout();
217
+        }
218
+    }
219
+
208 220
     /**
209 221
      * Removes all listeners.
210 222
      *
@@ -223,18 +235,6 @@ export default class AlwaysOnTop extends Component<*, State> {
223 235
         window.removeEventListener('mousemove', this._mouseMove);
224 236
     }
225 237
 
226
-    /**
227
-     * Sets a timeout to hide the toolbar when the toolbar is shown.
228
-     *
229
-     * @inheritdoc
230
-     * @returns {void}
231
-     */
232
-    componentWillUpdate(nextProps: *, nextState: State) {
233
-        if (!this.state.visible && nextState.visible) {
234
-            this._hideToolbarAfterTimeout();
235
-        }
236
-    }
237
-
238 238
     /**
239 239
      * Implements React's {@link Component#render()}.
240 240
      *

Ładowanie…
Anuluj
Zapisz