From 7f6f5acc59e772cb828b8e532e16d4c40465de65 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 3 Sep 2020 17:13:11 -0400 Subject: changed linkMenuItem follow behavior to work when one link is an annotation -- now it will follow to the link endpoint that is not an annotation --- src/client/views/linking/LinkMenuGroup.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/client/views/linking') diff --git a/src/client/views/linking/LinkMenuGroup.tsx b/src/client/views/linking/LinkMenuGroup.tsx index 2ae87ac13..8e09052a3 100644 --- a/src/client/views/linking/LinkMenuGroup.tsx +++ b/src/client/views/linking/LinkMenuGroup.tsx @@ -66,7 +66,8 @@ export class LinkMenuGroup extends React.Component { } render() { - const groupItems = this.props.group.map(linkDoc => { + const set = new Set(this.props.group); + const groupItems = Array.from(set.keys()).map(linkDoc => { const destination = LinkManager.Instance.getOppositeAnchor(linkDoc, this.props.sourceDoc) || LinkManager.Instance.getOppositeAnchor(linkDoc, Cast(linkDoc.anchor2, Doc, null).annotationOn === this.props.sourceDoc ? Cast(linkDoc.anchor2, Doc, null) : Cast(linkDoc.anchor1, Doc, null)); if (destination && this.props.sourceDoc) { -- cgit v1.2.3-70-g09d2