diff options
author | James Hu <51237606+jameshu111@users.noreply.github.com> | 2023-07-06 11:21:48 -0400 |
---|---|---|
committer | James Hu <51237606+jameshu111@users.noreply.github.com> | 2023-07-06 11:21:48 -0400 |
commit | 5379662bdc9279e43d35166ce8bafe042d0d7fb6 (patch) | |
tree | 53d474435e772d0652b7ac321224b21c89dbcaad /src/client/util/LinkManager.ts | |
parent | abeda176df59157f3194dd86966725f6193997c6 (diff) | |
parent | e4ad92e7300ee7844a514379c8a01d0f01cb3a59 (diff) |
Merge branch 'master' into james-azure-image
Diffstat (limited to 'src/client/util/LinkManager.ts')
-rw-r--r-- | src/client/util/LinkManager.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/util/LinkManager.ts b/src/client/util/LinkManager.ts index 3aa72f501..ce422f849 100644 --- a/src/client/util/LinkManager.ts +++ b/src/client/util/LinkManager.ts @@ -194,10 +194,8 @@ export class LinkManager { public static getOppositeAnchor(linkDoc: Doc, anchor: Doc): Doc | undefined { const a1 = Cast(linkDoc.link_anchor_1, Doc, null); const a2 = Cast(linkDoc.link_anchor_2, Doc, null); - if (Doc.AreProtosEqual(anchor, a1)) return a2; - if (Doc.AreProtosEqual(anchor, a2)) return a1; - if (Doc.AreProtosEqual(anchor, a1.annotationOn as Doc)) return a2; - if (Doc.AreProtosEqual(anchor, a2.annotationOn as Doc)) return a1; + if (Doc.AreProtosEqual(DocCast(anchor.annotationOn, anchor), DocCast(a1.annotationOn, a1))) return a2; + if (Doc.AreProtosEqual(DocCast(anchor.annotationOn, anchor), DocCast(a2.annotationOn, a2))) return a1; if (Doc.AreProtosEqual(anchor, linkDoc)) return linkDoc; } } |