aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/HypothesisUtils.ts
diff options
context:
space:
mode:
authorgeireann <geireann.lindfield@gmail.com>2021-09-12 10:03:00 -0400
committergeireann <geireann.lindfield@gmail.com>2021-09-12 10:03:00 -0400
commit939c7d092635e47e081aa8f047b73af36058f3b7 (patch)
tree7b5d4a9dce0c66ce3e2bd62755f536d41db48181 /src/client/util/HypothesisUtils.ts
parentf20dfa857e1651ced1eb2303ea8a8462483fbc4c (diff)
parentd9419c89ccdac7435c87b27a55486b7a5980ae29 (diff)
Merge branch 'menu_updates_geireann' of https://github.com/brown-dash/Dash-Web into menu_updates_geireann
Diffstat (limited to 'src/client/util/HypothesisUtils.ts')
-rw-r--r--src/client/util/HypothesisUtils.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/util/HypothesisUtils.ts b/src/client/util/HypothesisUtils.ts
index 635673025..e910a9118 100644
--- a/src/client/util/HypothesisUtils.ts
+++ b/src/client/util/HypothesisUtils.ts
@@ -29,7 +29,7 @@ export namespace Hypothesis {
* Search for a WebDocument whose url field matches the given uri, return undefined if not found
*/
export const findWebDoc = async (uri: string) => {
- const currentDoc = SelectionManager.Views().length && SelectionManager.Views()[0].props.Document;
+ const currentDoc = SelectionManager.Docs().lastElement();
if (currentDoc && Cast(currentDoc.data, WebField)?.url.href === uri) return currentDoc; // always check first whether the currently selected doc is the annotation's source, only use Search otherwise
const results: Doc[] = [];