From c974c54c22e79618f7589288887224efaf369dac Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Wed, 10 Jun 2020 23:23:45 -0500
Subject: fixed addScriptToGlobals in ScriptManager

---
 src/client/views/nodes/ScriptingBox.tsx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

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

diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx
index dc6fc142d..23e360663 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -247,13 +247,18 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
             return false;
         }
 
-        this.dataDoc.funcName = this.functionName;
-        this.dataDoc.descripition = this.functionDescription;
+        this.dataDoc.name = this.functionName;
+        this.dataDoc.description = this.functionDescription;
+        //this.dataDoc.parameters = this.compileParams;
+        this.dataDoc.script = this.rawScript;
 
-        ScriptManager.Instance.deleteScript(this.dataDoc);
+        //ScriptManager.Instance.deleteScript(this.dataDoc);
         ScriptManager.Instance.addScript(this.dataDoc);
 
         console.log("created");
+
+        this._scriptKeys = Scripting.getGlobals();
+        this._scriptGlobals = Scripting.getGlobalObj();
     }
 
     // overlays document numbers (ex. d32) over all documents when clicked on
-- 
cgit v1.2.3-70-g09d2

