diff options
author | bobzel <zzzman@gmail.com> | 2025-07-23 13:49:59 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-07-23 13:49:59 -0400 |
commit | 53f816699c77a178e43a314fc8f9335f5f1115f3 (patch) | |
tree | 248ec6e58971d7579c66b65f845f5bf03ba1de08 /src | |
parent | 3f489c64d9e55d452c255f8e2c10b0d754883dbb (diff) |
fix for having gpt operate on docs with newlines in their descriptions.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/pdf/GPTPopup/GPTPopup.tsx | 6 |
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 9c37428ee..b01a96c24 100644 --- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx +++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx @@ -93,8 +93,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 } |