From 8928ba1f332e319cab025987a098c87de607e853 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 24 Apr 2024 19:15:35 -0400 Subject: post merge eslint cleanup --- src/client/views/pdf/GPTPopup/GPTPopup.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/client/views/pdf') diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.tsx b/src/client/views/pdf/GPTPopup/GPTPopup.tsx index 560f2fd27..56ff2959c 100644 --- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx +++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx @@ -61,7 +61,7 @@ export class GPTPopup extends ObservableReactComponent { public dataChatPrompt: string | null = null; @action public setDataJson = (text: string) => { - if (text == '') this.dataChatPrompt = ''; + if (text === '') this.dataChatPrompt = ''; this.dataJson = text; }; @@ -134,14 +134,14 @@ export class GPTPopup extends ObservableReactComponent { this.setLoading(true); try { - const image_urls = await gptImageCall(this.imgDesc); - console.log('Image urls: ', image_urls); - if (image_urls && image_urls[0]) { - const [result] = await Networking.PostToServer('/uploadRemoteImage', { sources: [image_urls[0]] }); + const imageUrls = await gptImageCall(this.imgDesc); + console.log('Image urls: ', imageUrls); + if (imageUrls && imageUrls[0]) { + const [result] = await Networking.PostToServer('/uploadRemoteImage', { sources: [imageUrls[0]] }); console.log('Upload result: ', result); const source = ClientUtils.prepend(result.accessPaths.agnostic.client); console.log('Upload source: ', source); - this.setImgUrls([[image_urls[0], source]]); + this.setImgUrls([[imageUrls[0], source]]); } } catch (err) { console.error(err); @@ -168,7 +168,7 @@ export class GPTPopup extends ObservableReactComponent { GPTPopup.Instance.setVisible(true); GPTPopup.Instance.setLoading(true); try { - let res = await gptAPICall(this.dataJson, GPTCallType.DATA, this.dataChatPrompt); + const res = await gptAPICall(this.dataJson, GPTCallType.DATA, this.dataChatPrompt); GPTPopup.Instance.setText(res || 'Something went wrong.'); } catch (err) { console.error(err); @@ -396,7 +396,7 @@ export class GPTPopup extends ObservableReactComponent { render() { return (
- {this.mode === GPTPopupMode.SUMMARY ? this.summaryBox() : this.mode === GPTPopupMode.DATA ? this.dataAnalysisBox() : this.mode === GPTPopupMode.IMAGE ? this.imageBox() : <>} + {this.mode === GPTPopupMode.SUMMARY ? this.summaryBox() : this.mode === GPTPopupMode.DATA ? this.dataAnalysisBox() : this.mode === GPTPopupMode.IMAGE ? this.imageBox() : null}
); } -- cgit v1.2.3-70-g09d2