diff options
author | bobzel <zzzman@gmail.com> | 2024-05-20 15:59:52 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-05-20 15:59:52 -0400 |
commit | bb11e8c07f86b1ba0148f1e406a070c14e9abc7c (patch) | |
tree | 20fa2963e56a94550daf2a41c06d1ed7df9cd1b6 /src/client/views/pdf/AnchorMenu.tsx | |
parent | 46a2e250a40f30ff0bdfb4471f3905364e5ad803 (diff) |
lint cleanup and some flashcard fixes
Diffstat (limited to 'src/client/views/pdf/AnchorMenu.tsx')
-rw-r--r-- | src/client/views/pdf/AnchorMenu.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/pdf/AnchorMenu.tsx b/src/client/views/pdf/AnchorMenu.tsx index b7247a034..745e809db 100644 --- a/src/client/views/pdf/AnchorMenu.tsx +++ b/src/client/views/pdf/AnchorMenu.tsx @@ -78,13 +78,13 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> { * Invokes the API with the selected text and stores it in the summarized text. * @param e pointer down event */ - gptSummarize = async (e: React.PointerEvent) => { + gptSummarize = async () => { GPTPopup.Instance.setVisible(true); GPTPopup.Instance.setMode(GPTPopupMode.SUMMARY); GPTPopup.Instance.setLoading(true); try { - const res = await gptAPICall(this.selectedText, GPTCallType.SUMMARY); + const res = await gptAPICall(this._selectedText, GPTCallType.SUMMARY); GPTPopup.Instance.setText(res || 'Something went wrong.'); } catch (err) { console.error(err); @@ -100,8 +100,8 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> { * Invokes the API with the selected text and stores it in the selected text. * @param e pointer down event */ - gptFlashcards = async (e: React.PointerEvent) => { - const queryText = this.selectedText; + gptFlashcards = async () => { + const queryText = this._selectedText; try { const res = await gptAPICall(queryText, GPTCallType.FLASHCARD); console.log(res); @@ -120,7 +120,7 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> { // put each question generated by GPT on the front of the flashcard const senArr = text.split('Question'); const collectionArr: Doc[] = []; - for (var i = 1; i < senArr.length; i++) { + for (let i = 1; i < senArr.length; i++) { console.log('Arr ' + i + ': ' + senArr[i]); const newDoc = Docs.Create.ComparisonDocument(senArr[i], { _layout_isFlashcard: true, _width: 300, _height: 300 }); newDoc.text = senArr[i]; |