From 76582288310c5372dedf3feb45d548acfa3a7e9b Mon Sep 17 00:00:00 2001
From: bob <bcz@cs.brown.edu>
Date: Fri, 26 Apr 2019 14:18:33 -0400
Subject: details

---
 src/client/views/DocumentDecorations.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/client/views/DocumentDecorations.tsx')

diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 06d2f580c..0ea3bfc90 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -241,12 +241,15 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
     @action
     public getIconDoc = async (docView: DocumentView): Promise<Document | undefined> => {
         let doc = docView.props.Document;
-        return await doc.GetTAsync(KeyStore.MinimizedDoc, Document).then(async mindoc =>
+        let iconDoc = await doc.GetTAsync(KeyStore.MinimizedDoc, Document).then(async mindoc =>
             mindoc ? mindoc :
                 await doc.GetTAsync(KeyStore.BackgroundLayout, TextField).then(async field =>
                     (field instanceof TextField) ? this.createIcon(docView, field.Data) :
                         await doc.GetTAsync(KeyStore.Layout, TextField).then(field =>
                             (field instanceof TextField) ? this.createIcon(docView, field.Data) : undefined)));
+        if (SelectionManager.SelectedDocuments()[0].props.addDocument !== undefined)
+            SelectionManager.SelectedDocuments()[0].props.addDocument!(iconDoc!);
+        return iconDoc;
     }
     @action
     onMinimizeUp = (e: PointerEvent): void => {
-- 
cgit v1.2.3-70-g09d2

