aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/presentationview/PresentationElement.tsx
diff options
context:
space:
mode:
authormadelinegr <mgriswold99@gmail.com>2019-06-12 18:49:37 -0400
committermadelinegr <mgriswold99@gmail.com>2019-06-12 18:49:37 -0400
commit5c60cd95b3f766a18dee95ead388dd9f9603d138 (patch)
tree2ba24e51f3ddef3530b02c6281b2e114568cb6c3 /src/client/views/presentationview/PresentationElement.tsx
parent9a93306ba382018ebf3c686117bd4301beda61ef (diff)
Groups saving on refresh done
Diffstat (limited to 'src/client/views/presentationview/PresentationElement.tsx')
-rw-r--r--src/client/views/presentationview/PresentationElement.tsx25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/client/views/presentationview/PresentationElement.tsx b/src/client/views/presentationview/PresentationElement.tsx
index 9fe69c2e3..53e6f903b 100644
--- a/src/client/views/presentationview/PresentationElement.tsx
+++ b/src/client/views/presentationview/PresentationElement.tsx
@@ -71,22 +71,14 @@ export default class PresentationElement extends React.Component<PresentationEle
if (!castedList) {
this.props.presButtonBackUp.selectedButtonDocs = castedList = new List<Doc>();
}
- // let castedList = DocListCast(this.props.presButtonBackUp.selectedButtonDocs);
-
- console.log("Mounted!!");
- console.log("CastedList Len: ", castedList.length);
- console.log("Index of doc: ", this.props.index);
if (castedList.length <= this.props.index) {
- console.log("Entered here by index : ", this.props.index);
castedList.push(new Doc());
} else {
let curDoc: Doc = await castedList[this.props.index];
let selectedButtonOfDoc = Cast(curDoc.selectedButtons, listSpec("boolean"), null);
- console.log("Entered First Place");
if (selectedButtonOfDoc !== undefined) {
runInAction(() => this.selectedButtons = selectedButtonOfDoc);
- console.log("Entered Second Place");
}
}
@@ -167,6 +159,21 @@ export default class PresentationElement extends React.Component<PresentationEle
}
}
+ this.autoSaveGroupChanges();
+
+ }
+
+
+ @action
+ autoSaveGroupChanges = () => {
+ let castedList: List<Doc> = new List<Doc>();
+ this.props.presGroupBackUp.groupDocs = castedList;
+ this.props.groupMappings.forEach((docArray: Doc[], id: String) => {
+ let newGroupDoc = new Doc();
+ castedList.push(newGroupDoc);
+ newGroupDoc.presentIdStore = id.toString();
+ newGroupDoc.grouping = new List(docArray);
+ });
}
@@ -180,6 +187,8 @@ export default class PresentationElement extends React.Component<PresentationEle
} else {
this.selectedButtons[buttonIndex.Group] = true;
}
+ this.autoSaveButtonChange(buttonIndex.Group);
+
}
/**