From a83e575638a0efe81da7aa0204edd33bb8a6bb2f Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 20 Jan 2023 14:52:00 -0500
Subject: create stackedTimeline audio panels only when opened.  stopped
 loading link docs from other users if their link db's are not being used.

---
 src/client/util/SharingManager.tsx | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

(limited to 'src/client/util/SharingManager.tsx')

diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index 824a862cb..00ae85d12 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -8,7 +8,7 @@ import * as RequestPromise from 'request-promise';
 import { AclAdmin, AclPrivate, AclSym, AclUnset, DataSym, Doc, DocListCast, DocListCastAsync, HierarchyMapping, Opt } from '../../fields/Doc';
 import { Id } from '../../fields/FieldSymbols';
 import { List } from '../../fields/List';
-import { Cast, NumCast, StrCast } from '../../fields/Types';
+import { Cast, NumCast, PromiseValue, StrCast } from '../../fields/Types';
 import { distributeAcls, GetEffectiveAcl, normalizeEmail, SharingPermissions, TraceMobx } from '../../fields/util';
 import { Utils } from '../../Utils';
 import { DocServer } from '../DocServer';
@@ -138,12 +138,6 @@ export class SharingManager extends React.Component<{}> {
                     const sharingDoc = await DocServer.GetRefField(user.sharingDocumentId);
                     const linkDatabase = await DocServer.GetRefField(user.linkDatabaseId);
                     if (sharingDoc instanceof Doc && linkDatabase instanceof Doc) {
-                        await DocListCastAsync(linkDatabase.data);
-                        (await DocListCastAsync(Cast(linkDatabase, Doc, null).data))?.forEach(async link => {
-                            // makes sure link anchors are loaded to avoid incremental updates to computedFns in LinkManager
-                            const a1 = await Cast(link?.anchor1, Doc, null);
-                            const a2 = await Cast(link?.anchor2, Doc, null);
-                        });
                         sharingDocs.push({ user, sharingDoc, linkDatabase, userColor: StrCast(sharingDoc.userColor) });
                     }
                 }
@@ -153,7 +147,7 @@ export class SharingManager extends React.Component<{}> {
                     for (const sharer of sharingDocs) {
                         if (!this.users.find(user => user.user.email === sharer.user.email)) {
                             this.users.push(sharer);
-                            //LinkManager.addLinkDB(sharer.linkDatabase);
+                            // LinkManager.addLinkDB(sharer.linkDatabase);
                         }
                     }
                 });
-- 
cgit v1.2.3-70-g09d2

