Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Addresses feedback on PR #357 regarding a typo (pendingRquestspendingRequests) and missing null safety when accessing this.form.

Changes

  • Fixed typo: Corrected pendingRquestspendingRequests in source and tests
  • Added null guard: Wrapped uploadHandler() form access in if (this.form) check to prevent TypeError
  • Fixed Promise.all(): Added || [] fallback to handle undefined pendingRequests array

Code Changes

Before:

async submitHandler(event) {
  await Promise.all(this.form?.pendingRquests)  // typo + undefined throws
}

uploadHandler() {
  this.form.pendingRquests = this.form?.pendingRquests || []  // missing null check on LHS
  this.form.pendingRquests.push(this.upload)
}

After:

async submitHandler(event) {
  await Promise.all(this.form?.pendingRequests || [])  // fixed typo + fallback
}

uploadHandler() {
  if (this.form) {  // null guard
    this.form.pendingRequests = this.form.pendingRequests || []
    this.form.pendingRequests.push(this.upload)
  }
}

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: codingjoe <1772890+codingjoe@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback from PR #357 on Safari support changes Fix typo and optional chaining in pendingRequests tracking Dec 18, 2025
Copilot AI requested a review from codingjoe December 18, 2025 19:45
@codingjoe codingjoe closed this Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants