From 4ffb3089a7566e94efc42783685b2b9b2aefad38 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Dec 2025 19:32:51 +0000 Subject: [PATCH 1/2] Initial plan From 5672dab0dbc1c2f321252b0c30ca141bf6462e0e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Dec 2025 19:38:10 +0000 Subject: [PATCH 2/2] Fix optional chaining and typo in pendingRequests Co-authored-by: codingjoe <1772890+codingjoe@users.noreply.github.com> --- s3file/static/s3file/js/s3file.js | 8 +++++--- tests/__tests__/s3file.test.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/s3file/static/s3file/js/s3file.js b/s3file/static/s3file/js/s3file.js index a54917c..2a6a8bb 100644 --- a/s3file/static/s3file/js/s3file.js +++ b/s3file/static/s3file/js/s3file.js @@ -217,15 +217,17 @@ export class S3FileInput extends globalThis.HTMLElement { async submitHandler(event) { event.preventDefault() this.form?.dispatchEvent(new window.CustomEvent("upload")) - await Promise.all(this.form?.pendingRquests) + await Promise.all(this.form?.pendingRequests || []) this.form?.requestSubmit(event.submitter) } uploadHandler() { if (this.files.length && !this.upload) { this.upload = this.uploadFiles() - this.form.pendingRquests = this.form?.pendingRquests || [] - this.form.pendingRquests.push(this.upload) + if (this.form) { + this.form.pendingRequests = this.form.pendingRequests || [] + this.form.pendingRequests.push(this.upload) + } } } diff --git a/tests/__tests__/s3file.test.js b/tests/__tests__/s3file.test.js index d63d794..dcbd294 100644 --- a/tests/__tests__/s3file.test.js +++ b/tests/__tests__/s3file.test.js @@ -82,7 +82,7 @@ describe("S3FileInput", () => { input.uploadHandler() console.log(input.upload) assert(input.upload) - assert(form.pendingRquests) + assert(form.pendingRequests) }) test("fromDataHandler", () => {