Selaa lähdekoodia

ref(tooltbox): use componentDidUpdate to trigger more changes

master
Leonard Kim 7 vuotta sitten
vanhempi
commit
a045353e6e
1 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. 5
    5
      react/features/toolbox/components/web/Toolbox.js

+ 5
- 5
react/features/toolbox/components/web/Toolbox.js Näytä tiedosto

@@ -280,15 +280,15 @@ class Toolbox extends Component<Props> {
280 280
      *
281 281
      * @inheritdoc
282 282
      */
283
-    componentWillReceiveProps(nextProps) {
283
+    componentDidUpdate(prevProps) {
284 284
         // Ensure the dialog is closed when the toolbox becomes hidden.
285
-        if (this.props._overflowMenuVisible && !nextProps._visible) {
285
+        if (prevProps._overflowMenuVisible && !this.props._visible) {
286 286
             this._onSetOverflowVisible(false);
287 287
         }
288 288
 
289
-        if (this.props._overflowMenuVisible
290
-            && !this.props._dialog
291
-            && nextProps._dialog) {
289
+        if (prevProps._overflowMenuVisible
290
+            && !prevProps._dialog
291
+            && this.props._dialog) {
292 292
             this._onSetOverflowVisible(false);
293 293
             this.props.dispatch(setToolbarHovered(false));
294 294
         }

Loading…
Peruuta
Tallenna