Bug 1438755 - Part 3: Use timeScale object in latest props. r?gl draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 20 Mar 2018 14:42:18 +0900
changeset 769827 d58691efeffaf00abc25ad7945459bca4574257c
parent 769826 9845e068570464539220ffd22a7983dfc7ba0c59
child 769828 69b1a5b76c22ba59c9df87f564d1d7cec8c3a589
push id103228
push userbmo:dakatsuka@mozilla.com
push dateTue, 20 Mar 2018 06:02:17 +0000
reviewersgl
bugs1438755
milestone61.0a1
Bug 1438755 - Part 3: Use timeScale object in latest props. r?gl MozReview-Commit-ID: FPXyOsIfOr7
devtools/client/inspector/animation/components/graph/SummaryGraphPath.js
--- a/devtools/client/inspector/animation/components/graph/SummaryGraphPath.js
+++ b/devtools/client/inspector/animation/components/graph/SummaryGraphPath.js
@@ -40,22 +40,22 @@ class SummaryGraphPath extends PureCompo
       isStateUpdating: false,
       // List of keyframe which consists by only offset and easing.
       keyframesList: [],
     };
   }
 
   componentDidMount() {
     // No need to set isStateUpdating state since paint sequence is finish here.
-    this.updateState(this.props.animation);
+    this.updateState(this.props);
   }
 
   componentWillReceiveProps(nextProps) {
     this.setState({ isStateUpdating: true });
-    this.updateState(nextProps.animation);
+    this.updateState(nextProps);
   }
 
   shouldComponentUpdate(nextProps, nextState) {
     return !nextState.isStateUpdating;
   }
 
   /**
    * Return animatable keyframes list which has only offset and easing.
@@ -145,22 +145,23 @@ class SummaryGraphPath extends PureCompo
           keyframe1.easing !== keyframe2.easing) {
         return false;
       }
     }
 
     return true;
   }
 
-  async updateState(animation) {
+  async updateState(props) {
     const {
+      animation,
       emitEventForTest,
       getAnimatedPropertyMap,
       timeScale,
-    } = this.props;
+    } = props;
 
     let animatedPropertyMap = null;
 
     try {
       animatedPropertyMap = await getAnimatedPropertyMap(animation);
     } catch (e) {
       // Expected if we've already been destroyed or other node have been selected
       // in the meantime.