diff options
author | Mohammad Amoush <mohammad_amoush@brown.edu> | 2019-06-21 14:47:11 -0400 |
---|---|---|
committer | Mohammad Amoush <mohammad_amoush@brown.edu> | 2019-06-21 14:47:11 -0400 |
commit | 542f25d4af36cf0948696d45afba2e9e19f5bc37 (patch) | |
tree | 20e0bdb72f274ea920ca1721b9137fa4f76f4768 | |
parent | f4b75a7c921181faeeee04fbd57cd24fbd57523e (diff) |
Redo Grouping Fixed
-rw-r--r-- | src/client/views/presentationview/PresentationView.tsx | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx index 03e33dad7..f3e1d32fa 100644 --- a/src/client/views/presentationview/PresentationView.tsx +++ b/src/client/views/presentationview/PresentationView.tsx @@ -247,6 +247,7 @@ export class PresentationView extends React.Component<PresViewProps> { retrieveGroupMappings = async () => { let castedGroupDocs = await DocListCastAsync(this.presGroupBackUp.groupDocs); if (castedGroupDocs !== undefined) { + //runInAction(() => this.groupMappings = new Map()); castedGroupDocs.forEach(async (groupDoc: Doc, index: number) => { let castedGrouping = await DocListCastAsync(groupDoc.grouping); let castedKey = StrCast(groupDoc.presentIdStore, null); @@ -570,6 +571,7 @@ export class PresentationView extends React.Component<PresViewProps> { // }, "guid assignment"); }); } + runInAction(() => this.groupMappings = new Map()); } /** @@ -678,6 +680,7 @@ export class PresentationView extends React.Component<PresViewProps> { this.presentationsKeyMapping.set(newPresentationDoc, newGuid); this.resetGroupIds(); this.resetPresentation(); + this.presElementsMappings = new Map(); this.currentSelectedPresValue = newGuid; this.setPresentationBackUps(); @@ -694,6 +697,7 @@ export class PresentationView extends React.Component<PresViewProps> { this.curPresentation = this.presentationsMapping.get(selectedGuid)!; this.resetGroupIds(); this.resetPresentation(); + this.presElementsMappings = new Map(); this.currentSelectedPresValue = selectedGuid; this.setPresentationBackUps(); @@ -759,13 +763,25 @@ export class PresentationView extends React.Component<PresViewProps> { let curGuid = this.currentSelectedPresValue!; let curPresStatus = this.presStatus; + + this.curPresentation = nextDoc; + this.resetGroupIds(); + this.resetPresentation(); + this.currentSelectedPresValue = this.presentationsKeyMapping.get(nextDoc)!.toString(); + this.setPresentationBackUps(); + let currentGroups = this.groupMappings; + let curPresElemMapping = this.presElementsMappings; UndoManager.AddEvent({ undo: action(() => { this.curPresentation = removedDoc!; - this.presStatus = curPresStatus; this.presentationsMapping.set(curGuid, removedDoc!); this.presentationsKeyMapping.set(removedDoc!, curGuid); this.currentSelectedPresValue = curGuid; + //this.resetGroupIds(); + //this.resetPresentation(); + this.presStatus = curPresStatus; + this.groupMappings = currentGroups; + this.presElementsMappings = curPresElemMapping; this.setPresentationBackUps(); }), @@ -775,16 +791,13 @@ export class PresentationView extends React.Component<PresViewProps> { this.presentationsKeyMapping.delete(removedDoc!); this.presentationsMapping.delete(curGuid); this.currentSelectedPresValue = this.presentationsKeyMapping.get(nextDoc)!.toString(); + //this.resetGroupIds(); + // this.resetPresentation(); this.setPresentationBackUps(); }), }); - this.curPresentation = nextDoc; - this.resetGroupIds(); - this.resetPresentation(); - this.currentSelectedPresValue = this.presentationsKeyMapping.get(nextDoc)!.toString(); - this.setPresentationBackUps(); batch.end(); } } |