From ecc97b7d09f66b25a19b1e33d547e32d2f0a591d Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 13 Sep 2022 10:23:07 -0400 Subject: fixed errors. --- src/client/views/collections/TabDocView.tsx | 31 ++++++++++++++--------------- src/mobile/MobileInterface.tsx | 2 +- 2 files changed, 16 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx index 30fa33b52..7522affa7 100644 --- a/src/client/views/collections/TabDocView.tsx +++ b/src/client/views/collections/TabDocView.tsx @@ -213,11 +213,11 @@ export class TabDocView extends React.Component { public static PinDoc(docs: Doc | Doc[], pinProps?: PinProps) { const docList = docs instanceof Doc ? [docs] : docs; - let curPres = Doc.ActivePresentation - console.log(curPres) + let curPres = Doc.ActivePresentation; + console.log(curPres); if (!curPres) { curPres = Doc.MakeCopy(Doc.UserDoc().emptyPresentation as Doc, true); - Doc.ActivePresentation = curPres + Doc.ActivePresentation = curPres; } curPres && @@ -271,19 +271,18 @@ export class TabDocView extends React.Component { PresBox.Instance?.clearSelectedArray(); pinDoc && PresBox.Instance?.addToSelectedArray(pinDoc); //Update selected array }); - if ( - CollectionDockingView.Instance && - !Array.from(CollectionDockingView.Instance.tabMap) - .map(d => d.DashDoc) - .includes(curPres) - ) { - const docs = Cast(Doc.MyOverlayDocs.data, listSpec(Doc), []); - if (docs.includes(curPres)) docs.splice(docs.indexOf(curPres), 1); - CollectionDockingView.AddSplit(curPres, 'right'); - setTimeout(() => DocumentManager.Instance.jumpToDocument(docList.lastElement(), false, undefined, []), 100); // keeps the pinned doc in view since the sidebar shifts things - } - setTimeout(batch.end, 500); // need to wait until dockingview (goldenlayout) updates all its structurs - } + if ( + CollectionDockingView.Instance && + !Array.from(CollectionDockingView.Instance.tabMap) + .map(d => d.DashDoc) + .includes(curPres) + ) { + const docs = Cast(Doc.MyOverlayDocs.data, listSpec(Doc), []); + if (docs.includes(curPres)) docs.splice(docs.indexOf(curPres), 1); + CollectionDockingView.AddSplit(curPres, 'right'); + setTimeout(() => DocumentManager.Instance.jumpToDocument(docList.lastElement(), false, undefined, []), 100); // keeps the pinned doc in view since the sidebar shifts things + } + } componentDidMount() { new _global.ResizeObserver( diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx index f19496d25..8265de445 100644 --- a/src/mobile/MobileInterface.tsx +++ b/src/mobile/MobileInterface.tsx @@ -832,7 +832,7 @@ export class MobileInterface extends React.Component { {this.switchMenuView} {this.inkMenu} - +
-- cgit v1.2.3-70-g09d2