Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Conversation

Copy link

Copilot AI commented Nov 1, 2025

The submit button never transitioned to a processing state, leaving users uncertain if their submission was accepted. Multiple clicks could trigger duplicate API calls.

Changes

  • Added isSubmitting state to track submission lifecycle
  • Updated submitApplication function:
    • Guard against duplicate submissions with early return
    • Set button to processing state before API call
    • Added try-catch to handle network errors
    • Reset state on failure to allow retry
  • Updated button disabled logic to include isSubmitting check
async function submitApplication() {
  if (isSubmitting) return
  
  setIsSubmitting(true)
  setSubmitButton(`⏳ ${returnLocalizedMessage(router.locale, 'PROCESSING')}`)
  
  try {
    const submissionAPICall = await fetch(/*...*/)
    // Handle success/error and reset state on failure
  } catch (error) {
    setSubmitButton(`❌ ${returnLocalizedMessage(router.locale, 'ERROR')}`)
    setIsSubmitting(false)
  }
}

Button now properly transitions: Initial → Processing → Success/Error


💡 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.

@vercel
Copy link

vercel bot commented Nov 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
apply Ready Ready Preview Comment Nov 1, 2025 10:09pm

@leowilkin
Copy link
Member

Copilot AI changed the title [WIP] Fix submission button stuck on processing state Fix submission button stuck in initial state during API call Nov 1, 2025
Copilot AI requested a review from jeninh November 1, 2025 22:11
Copilot finished work on behalf of jeninh November 1, 2025 22:11
@alf1e
Copy link

alf1e commented Nov 1, 2025

bad AI, didnt fix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants