aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMelissa Zhang <mzhang19096@gmail.com>2020-08-06 11:47:16 -0700
committerMelissa Zhang <mzhang19096@gmail.com>2020-08-06 11:47:16 -0700
commitc94a61aa594f77db4c9b08a5f91c1a7e57d5ff9d (patch)
tree05ec5dbf849469682be709fb87084540e60ef95d /src
parent8c9e41ce30e37e55265a4ea8c52cd0567af227e4 (diff)
add compatibility for start/complete link buttons in the client
Diffstat (limited to 'src')
-rw-r--r--src/client/apis/hypothesis/HypothesisUtils.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/apis/hypothesis/HypothesisUtils.ts b/src/client/apis/hypothesis/HypothesisUtils.ts
index 075187934..de068c7d4 100644
--- a/src/client/apis/hypothesis/HypothesisUtils.ts
+++ b/src/client/apis/hypothesis/HypothesisUtils.ts
@@ -113,7 +113,8 @@ export namespace Hypothesis {
// listen for event from Hypothes.is plugin to link an annotation to Dash
export const linkListener = async (e: any) => {
const annotationId: string = e.detail.id;
- const annotationUri: string = StrCast(e.detail.uri).split("#annotations:")[0]; // clean hypothes.is URLs that reference a specific annotation (eg. https://en.wikipedia.org/wiki/Cartoon#annotations:t7qAeNbCEeqfG5972KR2Ig)
+ const annotationUri: string = StrCast(e.detail.uri).split("#annotations:")[0]; // clean hypothes.is URLs that reference a specific annotation
+ const isStart = (e.detail.isLinkStart === "true");
const sourceDoc: Doc = await getSourceWebDoc(annotationUri);
if (!DocumentLinksButton.StartLink) { // start link if there were none already started
@@ -123,7 +124,6 @@ export namespace Hypothesis {
DocumentLinksButton.StartLink = sourceDoc;
});
} else if (!Doc.AreProtosEqual(sourceDoc, DocumentLinksButton.StartLink)) { // if a link has already been started, complete the link to the sourceDoc
- console.log("completing link", sourceDoc.title);
runInAction(() => {
DocumentLinksButton.AnnotationId = annotationId;
DocumentLinksButton.AnnotationUri = annotationUri;