aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2019-06-18 16:30:24 -0400
committerFawn <fangrui_tong@brown.edu>2019-06-18 16:30:24 -0400
commit8e5afb5bbb47324a381b5184254e77eba7bd8536 (patch)
treef4dd95d0a071a3a7d6921b24de8eaa29fc370241 /src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
parent6fcd0d8d6fb1471b8af460f6d80bdf0d0e681566 (diff)
can click on button link to node in different context than source
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
index fc92c81d5..86625863f 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
@@ -190,12 +190,12 @@ export class CollectionFreeFormLinksView extends React.Component<CollectionViewP
return unique.map(u => {
// TODO: make better key
let key = StrCast(u.sourceView.Document[Id]) + "-link-" + StrCast(u.targetView.Document[Id]) + "-" + Date.now() + Math.random();
- let sourceIn = u.sourceView.props.ContainingCollectionView!.props.Document === this.props.Document;
- let targetIn = u.targetView.props.ContainingCollectionView!.props.Document === this.props.Document;
+ let sourceIn = u.sourceView.props.ContainingCollectionView ? u.sourceView.props.ContainingCollectionView.props.Document === this.props.Document : false;
+ let targetIn = u.targetView.props.ContainingCollectionView ? u.targetView.props.ContainingCollectionView.props.Document === this.props.Document : false;
let inContainer = u.sameContext ? sourceIn || targetIn : sourceIn;
if (inContainer) {
// console.log("key", key, StrCast(u.sourceView.Document.title), StrCast(u.targetView.Document.title));
- return <CollectionFreeFormLinkView key={key} sourceView={u.sourceView} targetView={u.targetView} sameContext={u.sameContext} />;
+ return <CollectionFreeFormLinkView key={key} sourceView={u.sourceView} targetView={u.targetView} sameContext={u.sameContext} addDocTab={this.props.addDocTab} />;
} else {
return <div key={key}></div>;
}