diff options
| author | bob <bcz@cs.brown.edu> | 2019-04-26 14:18:33 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-04-26 14:18:33 -0400 |
| commit | 76582288310c5372dedf3feb45d548acfa3a7e9b (patch) | |
| tree | bf4e1dfe75e43c565c73e53b943bb615a93321f4 /src/client/views/DocumentDecorations.tsx | |
| parent | 96b1e27da348e47a4d5c83b182a5f55e96e3218e (diff) | |
details
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
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 => { |
