diff options
| author | bobzel <zzzman@gmail.com> | 2024-11-22 10:27:33 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-11-22 10:27:33 -0500 |
| commit | 89424e0a8efc6cf3364a2fd1ffc85c9d0d837453 (patch) | |
| tree | 9f0bb770707b2e4239c0618d7435976bcc1c0f16 /src/client/views/pdf | |
| parent | 7b38bbc4d845fa524e8310a0ec05b0e776b47c82 (diff) | |
added initial Firefly endpoint and hanged smartDrawHandler to generate an image and an svg.
Diffstat (limited to 'src/client/views/pdf')
| -rw-r--r-- | src/client/views/pdf/AnchorMenu.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/views/pdf/AnchorMenu.tsx b/src/client/views/pdf/AnchorMenu.tsx index 5ab9b556c..fe03f32a5 100644 --- a/src/client/views/pdf/AnchorMenu.tsx +++ b/src/client/views/pdf/AnchorMenu.tsx @@ -131,12 +131,15 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> { /** * Creates a GPT drawing based on selected text. */ - gptDraw = async (e: React.PointerEvent) => { + gptDraw = (e: React.PointerEvent) => { try { SmartDrawHandler.Instance.AddDrawing = this.createDrawingAnnotation; runInAction(() => (this._isLoading = true)); - await SmartDrawHandler.Instance.drawWithGPT({ X: e.clientX, Y: e.clientY }, this._selectedText, 5, 100, true); - runInAction(() => (this._isLoading = false)); + SmartDrawHandler.Instance.drawWithGPT({ X: e.clientX, Y: e.clientY }, this._selectedText, 5, 100, true)?.then( + action(() => { + this._isLoading = false; + }) + ); } catch (err) { console.error(err); } |
