aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/HypothesisUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-09-14 16:07:51 -0400
committerbobzel <zzzman@gmail.com>2021-09-14 16:07:51 -0400
commit0fa9fd0f1c51c5a121a212635395bdb63ac28cd6 (patch)
treee7c98de1591146cf2a50c513a669d5b7308aea46 /src/client/util/HypothesisUtils.ts
parentabc5f96945fc0716fb1ccb4c99005bc7b7473086 (diff)
parent301652c454f3b74815aa7be2f2159e0a61d14e0b (diff)
merged with master
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[] = [];