diff --git a/packages/client/src/api/attachments.js b/packages/client/src/api/attachments.js index fdc47636c0..71624de6b2 100644 --- a/packages/client/src/api/attachments.js +++ b/packages/client/src/api/attachments.js @@ -1,5 +1,4 @@ import API from "./api" -import { notificationStore } from "../stores/index.js" /** * Uploads an attachment to the server. @@ -40,7 +39,7 @@ export const externalUpload = async (datasourceId, bucket, key, data) => { json: false, external: true, }) - if (res.error) { + if (res?.error) { throw "Could not upload file to signed URL" } } diff --git a/packages/client/src/components/app/forms/S3Upload.svelte b/packages/client/src/components/app/forms/S3Upload.svelte index 8072b92e59..256c6c41d5 100644 --- a/packages/client/src/components/app/forms/S3Upload.svelte +++ b/packages/client/src/components/app/forms/S3Upload.svelte @@ -98,29 +98,34 @@ bind:fieldApi defaultValue={[]} > - {#if fieldState} - { - fieldApi.setValue(e.detail) - }} - {processFiles} - {handleFileTooLarge} - maximum={1} - fileSizeLimit={MaxFileSize} - /> - {/if} - {#if loading} -
-
- -
- {/if} +
+ {#if fieldState} + { + fieldApi.setValue(e.detail) + }} + {processFiles} + {handleFileTooLarge} + maximum={1} + fileSizeLimit={MaxFileSize} + /> + {/if} + {#if loading} +
+
+ +
+ {/if} +