aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSubView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
-rw-r--r--src/client/views/collections/CollectionSubView.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 4d9ed358b..e045b351f 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -403,7 +403,6 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?:
}
if (uriList) {
const existingWebDoc = await Hypothesis.findWebDoc(uriList);
-
if (existingWebDoc) {
const alias = Doc.MakeAlias(existingWebDoc);
alias.x = options.x;
@@ -413,16 +412,17 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?:
alias._width = 400;
this.addDocument(alias);
} else {
- const cleanedUri = uriList.split("#annotations:")[0]; // clean hypothes.is URLs that reference a specific annotation (eg. https://en.wikipedia.org/wiki/Cartoon#annotations:t7qAeNbCEeqfG5972KR2Ig)
- this.addDocument(Docs.Create.WebDocument(uriList, {
+ const newDoc = Docs.Create.WebDocument(uriList, {
...options,
- title: cleanedUri,
+ title: uriList.split("#annotations:")[0],
_width: 400,
_height: 315,
_nativeWidth: 850,
_nativeHeight: 962,
UseCors: true
- }));
+ });
+ newDoc.data = new WebField(uriList.split("#annotations:")[0]); // clean hypothes.is URLs that reference a specific annotation (eg. https://en.wikipedia.org/wiki/Cartoon#annotations:t7qAeNbCEeqfG5972KR2Ig)
+ this.addDocument(newDoc);
}
return;
}