diff options
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r-- | src/client/views/MainView.tsx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index c151aebcd..98d0378be 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -685,18 +685,17 @@ export class MainView extends React.Component { mainContainerXf = () => this.sidebarScreenToLocal().translate(-this.leftScreenOffsetOfMainDocView, 0); addDocTabFunc = (doc: Doc, location: OpenWhere): boolean => { const whereFields = doc._viewType === CollectionViewType.Docking ? [OpenWhere.dashboard] : location.split(':'); - const whereMods = whereFields.length > 1 ? whereFields[1] : ''; + const whereMods = whereFields.length > 1 ? (whereFields[1] as OpenWhereMod) : OpenWhereMod.none; if (doc.dockingConfig) return DashboardView.openDashboard(doc); // prettier-ignore switch (whereFields[0]) { - default: - case OpenWhere.inPlace: + case OpenWhere.inPlace: // fall through to lightbox case OpenWhere.lightbox: return LightboxView.AddDocTab(doc, location); - case OpenWhere.add: return CollectionDockingView.AddSplit(doc, whereMods as OpenWhereMod); case OpenWhere.dashboard: return DashboardView.openDashboard(doc); - case OpenWhere.close: return CollectionDockingView.CloseSplit(doc, whereMods); case OpenWhere.fullScreen: return CollectionDockingView.OpenFullScreen(doc); - case OpenWhere.toggle: return CollectionDockingView.ToggleSplit(doc, whereMods as OpenWhereMod); + case OpenWhere.close: return CollectionDockingView.CloseSplit(doc, whereMods); + case OpenWhere.toggle: return CollectionDockingView.ToggleSplit(doc, whereMods); + case OpenWhere.add:default:return CollectionDockingView.AddSplit(doc, whereMods); } }; |