From 4f1acae3f4a87acc91e05d7d46fb33278c08292b Mon Sep 17 00:00:00 2001
From: andrewdkim <adkim414@gmail.com>
Date: Fri, 12 Jul 2019 16:48:07 -0400
Subject: Fixed Bugs, Timeline Movement, improved interpolation, organization

---
 src/client/views/nodes/Track.tsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'src/client/views/nodes/Track.tsx')

diff --git a/src/client/views/nodes/Track.tsx b/src/client/views/nodes/Track.tsx
index c1c722d62..b00001e54 100644
--- a/src/client/views/nodes/Track.tsx
+++ b/src/client/views/nodes/Track.tsx
@@ -12,6 +12,7 @@ import { AddComparisonParameters } from "../../northstar/model/idea/idea";
 import { RichTextField } from "../../../new_fields/RichTextField";
 import { node } from "prop-types";
 import { NorthstarSettings } from "../../northstar/manager/Gateway";
+import { getForkTsCheckerWebpackPluginHooks } from "fork-ts-checker-webpack-plugin/lib/hooks";
 
 interface IProps {
     node: Doc;
@@ -35,14 +36,15 @@ export class Track extends React.Component<IProps> {
     }
 
     componentWillMount() {
-        this.props.node.regions = new List<Doc>();
+        if (!this.props.node.regions){
+            this.props.node.regions = new List<Doc>();
+        }
         this.props.node.opacity = 1; 
     }
 
     @action
     componentDidMount() {
         this.props.node.hidden = true;
-        this.props.node.opacity = 1;
 
         this._reactionDisposers.push(reaction(() => this.props.currentBarX, () => {
             let regiondata: (Doc | undefined) = this.findRegion(this.props.currentBarX);
@@ -102,7 +104,6 @@ export class Track extends React.Component<IProps> {
             this.filterKeys(Doc.allKeys(currentkf.key as Doc)).forEach(k => {
                 this.props.node[k] = (currentkf!.key as Doc)[k];  
             }); 
-            console.log("current"); 
         } else if (leftkf && rightkf) {
             this.interpolate(leftkf, rightkf);
         } else if (leftkf) {                
@@ -238,7 +239,7 @@ export class Track extends React.Component<IProps> {
             <div className="track-container">
                 <div className="track">
                     <div className="inner" ref={this._inner} onDoubleClick={this.onInnerDoubleClick}>
-                        {this.regions.map((region) => {
+                        {DocListCast(this.regions).map((region) => {
                             return <Keyframe node={this.props.node} RegionData={region as Doc} changeCurrentBarX={this.props.changeCurrentBarX} setFlyout={this.props.setFlyout}/>;
                         })}
                     </div>
-- 
cgit v1.2.3-70-g09d2

