From 5ed05b89fbe1b5ccc34dfd342098bd1e6ac3935c Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Mon, 2 Nov 2020 23:02:51 +0800 Subject: bug fix - avoiding document view --- src/client/views/nodes/PresBox.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 518d365ed..699f56620 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -412,7 +412,7 @@ export class PresBox extends ViewBoxBaseComponent onHideDocument = () => { this.childDocs.forEach((doc, index) => { const curDoc = Cast(doc, Doc, null); - const tagDoc = Cast(curDoc.presentationTargetDoc!, Doc, null); + const tagDoc = Cast(curDoc.presentationTargetDoc, Doc, null); if (tagDoc) tagDoc.opacity = 1; const itemIndexes: number[] = this.getAllIndexes(this.tagDocs, tagDoc); const curInd: number = itemIndexes.indexOf(index); @@ -644,7 +644,7 @@ export class PresBox extends ViewBoxBaseComponent @computed get listOfSelected() { const list = Array.from(this._selectedArray.keys()).map((doc: Doc, index: any) => { const curDoc = Cast(doc, Doc, null); - const tagDoc = Cast(curDoc.presentationTargetDoc!, Doc, null); + const tagDoc = Cast(curDoc.presentationTargetDoc, Doc, null); if (curDoc && curDoc === this.activeItem) return
{index + 1}. {curDoc.title}
; else if (tagDoc) return
{index + 1}. {curDoc.title}
; else if (curDoc) return
{index + 1}. {curDoc.title}
; @@ -653,9 +653,9 @@ export class PresBox extends ViewBoxBaseComponent } @action - selectPres = (pres?: Doc) => { - const presDocView = DocumentManager.Instance.getDocumentView(pres ? pres : this.rootDoc)!; - SelectionManager.SelectDoc(presDocView, false); + selectPres = () => { + const presDocView = DocumentManager.Instance.getDocumentView(this.rootDoc); + presDocView && SelectionManager.SelectDoc(presDocView, false); } //Regular click -- cgit v1.2.3-70-g09d2