From 5e04d7f94d180dc984e48eca888ac2cedfd0c7a3 Mon Sep 17 00:00:00 2001
From: ab <abdullah_ahmed@brown.edu>
Date: Thu, 17 Oct 2019 13:18:52 -0400
Subject: image stuff

---
 src/client/views/nodes/DocumentView.tsx | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

(limited to 'src/client/views/nodes/DocumentView.tsx')

diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index ab2717eed..960ec744e 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -589,16 +589,26 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
         ClientRecommender.Instance.reset_docs();
         //ClientRecommender.Instance.arxivrequest("electrons");
         await Promise.all(allDocs.map((doc: Doc) => {
-            let mainDoc: boolean = false;
+            let isMainDoc: boolean = false;
             const dataDoc = Doc.GetDataDoc(doc);
             if (doc.type === DocumentType.TEXT) {
                 if (dataDoc === Doc.GetDataDoc(this.props.Document)) {
-                    mainDoc = true;
+                    isMainDoc = true;
                 }
                 if (!documents.includes(dataDoc)) {
                     documents.push(dataDoc);
                     const extdoc = doc.data_ext as Doc;
-                    return ClientRecommender.Instance.extractText(doc, extdoc ? extdoc : doc, true, mainDoc);
+                    return ClientRecommender.Instance.extractText(doc, extdoc ? extdoc : doc, true, isMainDoc);
+                }
+            }
+            if (doc.type === DocumentType.IMG) {
+                if (dataDoc === Doc.GetDataDoc(this.props.Document)) {
+                    isMainDoc = true;
+                }
+                if (!documents.includes(dataDoc)) {
+                    documents.push(dataDoc);
+                    const extdoc = doc.data_ext as Doc;
+                    return ClientRecommender.Instance.extractText(doc, extdoc ? extdoc : doc, true, isMainDoc, true);
                 }
             }
         }));
-- 
cgit v1.2.3-70-g09d2

