aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-04-24 19:15:35 -0400
committerbobzel <zzzman@gmail.com>2024-04-24 19:15:35 -0400
commit8928ba1f332e319cab025987a098c87de607e853 (patch)
treef3c3ed84556286e00cea69e86134fdb094d38c2a /src/client/views/pdf
parentb9825ff743ea853139a4072ce871d36d00227c4b (diff)
post merge eslint cleanup
Diffstat (limited to 'src/client/views/pdf')
-rw-r--r--src/client/views/pdf/GPTPopup/GPTPopup.tsx16
1 files changed, 8 insertions, 8 deletions
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<GPTPopupProps> {
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<GPTPopupProps> {
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<GPTPopupProps> {
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<GPTPopupProps> {
render() {
return (
<div className="summary-box" style={{ display: this.visible ? 'flex' : 'none' }}>
- {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}
</div>
);
}