aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-10-04 15:55:37 -0400
committerbobzel <zzzman@gmail.com>2021-10-04 15:55:37 -0400
commit76b833efe198a672795f61ee7a4b8d8cd6d5dd49 (patch)
treefce4439f34de6a80b9979c88215a3da10bad2d8c /src/client/util
parentc654a67db0da26abbf0ab920e8925d872443d22a (diff)
fixed dropping onto comparison box. added caption of link description to link comparison view. added promise wait for protos of link anchors to avoid potential crash. made dragging a link off of a linkmenuitem to create an alias with the hidden flag removed.
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/LinkManager.ts18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/client/util/LinkManager.ts b/src/client/util/LinkManager.ts
index 64da68f59..53bd13fb3 100644
--- a/src/client/util/LinkManager.ts
+++ b/src/client/util/LinkManager.ts
@@ -38,15 +38,19 @@ export class LinkManager {
const addLinkToDoc = (link: Doc) => {
const a1Prom = link?.anchor1;
const a2Prom = link?.anchor2;
- Promise.all([a1Prom, a2Prom]).then(action((all) => {
+ Promise.all([a1Prom, a2Prom]).then((all) => {
const a1 = all[0];
const a2 = all[1];
- if (a1 instanceof Doc && a2 instanceof Doc && ((a1.author !== undefined && a2.author !== undefined) || link.author === Doc.CurrentUserEmail)) {
- Doc.GetProto(a1)[DirectLinksSym].add(link);
- Doc.GetProto(a2)[DirectLinksSym].add(link);
- Doc.GetProto(link)[DirectLinksSym].add(link);
- }
- }));
+ const a1ProtoProm = (link?.anchor1 as Doc)?.proto;
+ const a2ProtoProm = (link?.anchor2 as Doc)?.proto;
+ Promise.all([a1ProtoProm, a2ProtoProm]).then(action((all) => {
+ if (a1 instanceof Doc && a2 instanceof Doc && ((a1.author !== undefined && a2.author !== undefined) || link.author === Doc.CurrentUserEmail)) {
+ Doc.GetProto(a1)[DirectLinksSym].add(link);
+ Doc.GetProto(a2)[DirectLinksSym].add(link);
+ Doc.GetProto(link)[DirectLinksSym].add(link);
+ }
+ }));
+ });
};
const remLinkFromDoc = (link: Doc) => {
const a1 = link?.anchor1;