From a79431a47aa7fdff8e55ff653f28dd23c9af4650 Mon Sep 17 00:00:00 2001
From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com>
Date: Sun, 15 Dec 2024 05:13:35 -0500
Subject: Temprarily reverted static field rerendering changes; Persistent
 rendereddoc now working for dynamic field; work on making adding fields
 functional

---
 src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx')

diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx
index e079af4de..0e1ddc28f 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx
@@ -17,8 +17,9 @@ export class Template {
 
     constructor(templateInfo: FieldSettings) {
         makeAutoObservable(this);
-        this.mainField = this.setupMainField(templateInfo);
         this.settings = templateInfo;
+        this.mainField = this.setupMainField(templateInfo);
+        console.log(templateInfo);
     }
 
     get childFields(): Field[] { return this.mainField.getSubfields };
@@ -33,10 +34,13 @@ export class Template {
 
     cloneBase = () => {
         const clone: Template = new Template(this.settings);
-        clone.allFields.forEach(field => {
+        
+        clone.allFields.filter(field => field !== clone.mainField).forEach(field => {
+            console.log('id:', field.getID);
             const matchingField: Field = this.allFields.filter(f => f.getID === field.getID)[0];
             matchingField.applyAttributes(field);
         })
+        clone.mainField.updateRenderedDoc();
         return clone;
     }
 
-- 
cgit v1.2.3-70-g09d2

