From c6854180ca1aa488d36722d42afdf8ccf6dd588b Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Sat, 30 Mar 2024 09:13:12 -0400
Subject: fixed snapshot workspace functions by getting rid of @actions.  fixed
 lightbox to not rerende on invalidation which allows videos to play.

---
 .../views/collections/CollectionDockingView.tsx     | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

(limited to 'src/client/views/collections/CollectionDockingView.tsx')

diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 8f1633122..25bfdb588 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -468,10 +468,15 @@ export class CollectionDockingView extends CollectionSubView() {
             json = json.replace(origtab[Id], newtab[Id]);
             return newtab;
         });
-        const copy = Docs.Create.DockDocument(newtabs, json, { title: incrementTitleCopy(StrCast(doc.title)) });
-        DashboardView.SetupDashboardTrails(copy);
-        DashboardView.SetupDashboardCalendars(copy); // Zaul TODO: needed?
-        return DashboardView.openDashboard(copy);
+        const dashboardDoc = Docs.Create.DockDocument(newtabs, json, { title: incrementTitleCopy(StrCast(doc.title)) });
+
+        dashboardDoc.pane_count = 1;
+        dashboardDoc.myOverlayDocs = new List<Doc>();
+        dashboardDoc.myPublishedDocs = new List<Doc>();
+
+        DashboardView.SetupDashboardTrails(dashboardDoc);
+        DashboardView.SetupDashboardCalendars(dashboardDoc); // Zaul TODO: needed?
+        return DashboardView.openDashboard(dashboardDoc);
     }
 
     @action
@@ -512,13 +517,13 @@ export class CollectionDockingView extends CollectionSubView() {
         stack.header?.element.on('mousedown', (e: any) => {
             const dashboard = Doc.ActiveDashboard;
             if (dashboard && e.target === stack.header?.element[0] && e.button === 2) {
-                dashboard['pane-count'] = NumCast(dashboard['pane-count']) + 1;
+                dashboard.pane_count = NumCast(dashboard.pane_count) + 1;
                 const docToAdd = Docs.Create.FreeformDocument([], {
                     _width: this._props.PanelWidth(),
                     _height: this._props.PanelHeight(),
                     _freeform_backgroundGrid: true,
                     _layout_fitWidth: true,
-                    title: `Untitled Tab ${NumCast(dashboard['pane-count'])}`,
+                    title: `Untitled Tab ${NumCast(dashboard.pane_count)}`,
                 });
                 Doc.AddDocToList(Doc.MyHeaderBar, 'data', docToAdd, undefined, undefined, true);
                 inheritParentAcls(this.Document, docToAdd, false);
@@ -530,13 +535,13 @@ export class CollectionDockingView extends CollectionSubView() {
             action(() => {
                 const dashboard = Doc.ActiveDashboard;
                 if (dashboard) {
-                    dashboard['pane-count'] = NumCast(dashboard['pane-count']) + 1;
+                    dashboard.pane_count = NumCast(dashboard.pane_count) + 1;
                     const docToAdd = Docs.Create.FreeformDocument([], {
                         _width: this._props.PanelWidth(),
                         _height: this._props.PanelHeight(),
                         _layout_fitWidth: true,
                         _freeform_backgroundGrid: true,
-                        title: `Untitled Tab ${NumCast(dashboard['pane-count'])}`,
+                        title: `Untitled Tab ${NumCast(dashboard.pane_count)}`,
                     });
                     Doc.AddDocToList(Doc.MyHeaderBar, 'data', docToAdd, undefined, undefined, true);
                     inheritParentAcls(this.dataDoc, docToAdd, false);
-- 
cgit v1.2.3-70-g09d2

