From bfd6e4cfbe79f75ba68e94e29e858611ec8f9f9c Mon Sep 17 00:00:00 2001
From: Mohammad Amoush <mohammad_amoush@brown.edu>
Date: Mon, 8 Jul 2019 19:19:25 -0400
Subject: SOme bugs fixed but still buggy

---
 src/client/views/presentationview/PresentationView.tsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'src/client/views/presentationview/PresentationView.tsx')

diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx
index c1f5fac60..5db87a692 100644
--- a/src/client/views/presentationview/PresentationView.tsx
+++ b/src/client/views/presentationview/PresentationView.tsx
@@ -1,6 +1,6 @@
 import { observer } from "mobx-react";
 import React = require("react");
-import { observable, action, runInAction, reaction } from "mobx";
+import { observable, action, runInAction, reaction, autorun } from "mobx";
 import "./PresentationView.scss";
 import { DocumentManager } from "../../util/DocumentManager";
 import { Utils } from "../../../Utils";
@@ -65,6 +65,7 @@ export class PresentationView extends React.Component<PresViewProps>  {
     constructor(props: PresViewProps) {
         super(props);
         PresentationView.Instance = this;
+        // autorun(() => console.log("Updated: ", this.presElementsMappings));
     }
 
     //The first lifecycle function that gets called to set up the current presentation.
@@ -327,6 +328,8 @@ export class PresentationView extends React.Component<PresViewProps>  {
         if (curDocPresId !== undefined) {
             if (this.groupMappings.has(curDocPresId)) {
                 let currentDocGroup = this.groupMappings.get(curDocPresId)!;
+                Array.from(this.presElementsMappings.keys()).map(doc => console.log(doc[Id]));
+                console.log("\n");
                 currentDocGroup.forEach((doc: Doc, index: number) => {
                     let selectedButtons: boolean[] = this.presElementsMappings.get(doc)!.selected;
                     if (selectedButtons[buttonIndex.Navigate]) {
@@ -773,6 +776,7 @@ export class PresentationView extends React.Component<PresViewProps>  {
 
     addPressElem = (keyDoc: Doc, elem: PresentationElement) => {
         this.presElementsMappings.set(keyDoc, elem);
+        // console.log(keyDoc, " : ", elem, " => ", this.presElementsMappings.size);
     }
 
 
@@ -805,12 +809,13 @@ export class PresentationView extends React.Component<PresViewProps>  {
                     deleteDocument={this.RemoveDoc}
                     gotoDocument={this.gotoDocument}
                     groupMappings={this.groupMappings}
-                    setPresElementsMappings={this.addPressElem}
+                    PresElementsMappings={this.presElementsMappings}
                     setChildrenDocs={this.setChildrenDocs}
                     presStatus={this.presStatus}
                     presButtonBackUp={this.presButtonBackUp}
                     presGroupBackUp={this.presGroupBackUp}
                     removeDocByRef={this.removeDocByRef}
+                    clearElemMap={() => this.presElementsMappings.clear()}
                 />
             </div>
         );
-- 
cgit v1.2.3-70-g09d2

