diff options
| author | bobzel <zzzman@gmail.com> | 2020-10-21 23:09:41 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-10-21 23:09:41 -0400 |
| commit | fb918c91e9c7533868601c6d3e23687b5dccf1df (patch) | |
| tree | 5e36aebf7cdd0b27ca13bef535645253dfb1c9ea /src/client/views/collections | |
| parent | a4321991ae32044be01606f0f2635468edc3887e (diff) | |
fixed warnings. fixed pinning of multiple documents at the same time to bring up the presentation view just once.
Diffstat (limited to 'src/client/views/collections')
| -rw-r--r-- | src/client/views/collections/TabDocView.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx index 338b1d590..9c5f7c66e 100644 --- a/src/client/views/collections/TabDocView.tsx +++ b/src/client/views/collections/TabDocView.tsx @@ -124,7 +124,7 @@ export class TabDocView extends React.Component<TabDocViewProps> { **/ @undoBatch @action - public static async PinDoc(doc: Doc, unpin = false, audioRange?: boolean) { + public static PinDoc(doc: Doc, unpin = false, audioRange?: boolean) { if (unpin) console.log('TODO: Remove UNPIN from this location'); //add this new doc to props.Document const curPres = CurrentUserUtils.ActivePresentation; @@ -140,11 +140,15 @@ export class TabDocView extends React.Component<TabDocViewProps> { pinDoc.presEndTime = doc.duration; } if (curPres.expandBoolean) pinDoc.presExpandInlineButton = true; - const curPresDocView = DocumentManager.Instance.getDocumentView(curPres); - if (!curPresDocView) { + const dview = CollectionDockingView.Instance.props.Document; + const fieldKey = CollectionDockingView.Instance.props.fieldKey; + const sublists = DocListCast(dview[fieldKey]); + const tabs = Cast(sublists[0], Doc, null); + const tabdocs = DocListCast(tabs.data); + if (!tabdocs.includes(curPres)) { CollectionDockingView.AddSplit(curPres, "right"); } - await DocumentManager.Instance.jumpToDocument(doc, false, undefined); + DocumentManager.Instance.jumpToDocument(doc, false, undefined); } } |
