diff options
author | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-10-14 02:46:05 +0800 |
---|---|---|
committer | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-10-14 02:46:05 +0800 |
commit | e1f733fa7e2772c7d0c2d77d890005b7bcb0dd79 (patch) | |
tree | f72f22559fa14b480c9767cc5d4facff2317ec61 /src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx | |
parent | 80ccba05db32ca09ac513f3ec370f3deef873ce7 (diff) | |
parent | d87cd4f20a8b5b4f33d799a4ef42fb14337638a5 (diff) |
Merge branch 'master' into presentation_v1
Diffstat (limited to 'src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx')
-rw-r--r-- | src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx b/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx index f96fda861..0919b2b14 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx @@ -6,7 +6,7 @@ import { EditorState, Plugin } from "prosemirror-state"; import { EditorView } from "prosemirror-view"; import * as ReactDOM from 'react-dom'; import wiki from "wikijs"; -import { Doc, DocCastAsync, Opt } from "../../../../fields/Doc"; +import { Doc, DocCastAsync, Opt, DocListCast } from "../../../../fields/Doc"; import { Cast, FieldValue, NumCast, StrCast } from "../../../../fields/Types"; import { emptyFunction, emptyPath, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnOne, Utils } from "../../../../Utils"; import { DocServer } from "../../../DocServer"; @@ -256,7 +256,7 @@ export class FormattedTextBoxComment { docTarget && DocServer.GetRefField(docTarget).then(async linkDoc => { if (linkDoc instanceof Doc) { (FormattedTextBoxComment.tooltipText as any).href = href; - FormattedTextBoxComment.linkDoc = linkDoc; + FormattedTextBoxComment.linkDoc = DocListCast(textBox.props.Document.links).find(link => link.anchor1 === textBox.props.Document || link.anchor2 === textBox.props.Document ? link : undefined) || linkDoc; const anchor = FieldValue(Doc.AreProtosEqual(FieldValue(Cast(linkDoc.anchor1, Doc)), textBox.dataDoc) ? Cast(linkDoc.anchor2, Doc) : (Cast(linkDoc.anchor1, Doc)) || linkDoc); const target = anchor?.annotationOn ? await DocCastAsync(anchor.annotationOn) : anchor; if (anchor !== target && anchor && target) { |