aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SharingManager.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-11-24 12:43:01 -0500
committerbobzel <zzzman@gmail.com>2020-11-24 12:43:01 -0500
commit51ddd53c847992c1cdba9625a81fb4f380a3b95b (patch)
treedfa07ecfa3bef1c92923d6924d206308cc529328 /src/client/util/SharingManager.tsx
parent236bed717c721f56a60a57b189241a4cf714463c (diff)
prevent possible crash on empty text box hypertext link. prevent Webbox's from updating .text field every time loaded. avoided slow incremental updating of LinkDB by awaating document anchors when linkdb is setup.
Diffstat (limited to 'src/client/util/SharingManager.tsx')
-rw-r--r--src/client/util/SharingManager.tsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index 2b13d2a44..062852e36 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -134,6 +134,10 @@ export class SharingManager extends React.Component<{}> {
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.color) });
}
}