aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf
diff options
context:
space:
mode:
authorsharkiecodes <lanyi_stroud@brown.edu>2025-07-23 14:45:59 -0400
committersharkiecodes <lanyi_stroud@brown.edu>2025-07-23 14:45:59 -0400
commit7f49356b9460d46a06e7b7d67c369c4bb1d4bbe5 (patch)
treeb9efa7d22ab520c171dd783509b4fbb8cbe146d7 /src/client/views/pdf
parent968cbfa1fd18bba2b2857d756a88f8a036bd45fa (diff)
parenteea5881bddaa66ebe544bdfc94ce80fd0fbf8860 (diff)
Merge branch 'lanyi-expanded-agent-paper-main' of https://github.com/brown-dash/Dash-Web into lanyi-expanded-agent-paper-main
Diffstat (limited to 'src/client/views/pdf')
-rw-r--r--src/client/views/pdf/GPTPopup/GPTPopup.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.tsx b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
index 6e0d58932..65be98c83 100644
--- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx
+++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
@@ -92,8 +92,12 @@ export class GPTPopup extends ObservableReactComponent<object> {
this.onGptResponse = (sortResult: string, questionType: GPTDocCommand) => this.processGptResponse(selDoc, this._textToDocMap, sortResult, questionType);
this.onQuizRandom = () => this.randomlyChooseDoc(selDoc.Document, hasChildDocs());
this._documentDescriptions = Promise.all(hasChildDocs().map(doc =>
- Doc.getDescription(doc).then(text => this._textToDocMap.set(text.replace(/\n/g, ' ').trim(), doc) && `${DescriptionSeperator}${text}${DescriptionSeperator}`)
+ Doc.getDescription(doc).then(text => text.replace(/\n/g, ' ').trim())
+ .then(text => this._textToDocMap.set(text, doc) && `${DescriptionSeperator}${text}${DescriptionSeperator}`)
)).then(docDescriptions => docDescriptions.join()); // prettier-ignore
+ this._documentDescriptions.then(descs => {
+ console.log(descs);
+ });
}
},
{ fireImmediately: true }