From 5e22d4aa9eefb8c92859fc0d1adb508429af2106 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Fri, 10 Jul 2020 10:58:38 -0400 Subject: not sure if these changes are needed, but I had to add them to get Hypothesis links to work. --- src/client/views/nodes/DocumentLinksButton.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/client/views/nodes/DocumentLinksButton.tsx') diff --git a/src/client/views/nodes/DocumentLinksButton.tsx b/src/client/views/nodes/DocumentLinksButton.tsx index 32c344304..223d9fbf8 100644 --- a/src/client/views/nodes/DocumentLinksButton.tsx +++ b/src/client/views/nodes/DocumentLinksButton.tsx @@ -35,6 +35,7 @@ export class DocumentLinksButton extends React.Component { // event used by Hypothes.is plugin to tell Dash when an unlinked annotation has been created @@ -47,12 +48,15 @@ export class DocumentLinksButton extends React.Component { // event used by Hypothes.is plugin to tell Dash when an unlinked annotation has been created + if (e.handled) return; + e.handled = true; console.log("Helo fake annotation make"); // const id = e.detail; - const id = await Hypothesis.getPlaceholderId("melissaz", "placeholder"); // delete once eventListening between client & Dash works + const response = await Hypothesis.getPlaceholderId("bobzel", "placeholder"); // delete once eventListening between client & Dash works const source = SelectionManager.SelectedDocuments()[0]; - runInAction(() => { - DocumentLinksButton.AnnotationId = id; + response && runInAction(() => { + DocumentLinksButton.AnnotationId = response.id; + DocumentLinksButton.AnnotationUri = response.uri; DocumentLinksButton.StartLink = source; }); }); @@ -127,8 +131,8 @@ export class DocumentLinksButton extends React.Component