aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/HypothesisUtils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util/HypothesisUtils.ts')
-rw-r--r--src/client/util/HypothesisUtils.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/client/util/HypothesisUtils.ts b/src/client/util/HypothesisUtils.ts
index f46c2d431..c5f307f44 100644
--- a/src/client/util/HypothesisUtils.ts
+++ b/src/client/util/HypothesisUtils.ts
@@ -30,15 +30,15 @@ export namespace Hypothesis {
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[] = [];
- await SearchUtil.Search('web', true).then(
- action(async (res: SearchUtil.DocSearchResult) => {
- const docs = res.docs;
- const filteredDocs = docs.filter(doc => doc.author === Doc.CurrentUserEmail && doc.type === DocumentType.WEB && doc.data);
- filteredDocs.forEach(doc => {
- uri === Cast(doc.data, WebField)?.url.href && results.push(doc); // TODO check visited sites history?
- });
- })
- );
+ // await SearchUtil.Search('web', true).then(
+ // action(async (res: SearchUtil.DocSearchResult) => {
+ // const docs = res.docs;
+ // const filteredDocs = docs.filter(doc => doc.author === Doc.CurrentUserEmail && doc.type === DocumentType.WEB && doc.data);
+ // filteredDocs.forEach(doc => {
+ // uri === Cast(doc.data, WebField)?.url.href && results.push(doc); // TODO check visited sites history?
+ // });
+ // })
+ // );
const onScreenResults = results.filter(doc => DocumentManager.Instance.getFirstDocumentView(doc));
return onScreenResults.length ? onScreenResults[0] : results.length ? results[0] : undefined; // prioritize results that are currently on the screen