Skip to content

fix: add-company modal not closing after successful save#397

Open
Lp-Francois wants to merge 1 commit into
cursor:mainfrom
Lp-Francois:fix/close-add-company-modal-on-save
Open

fix: add-company modal not closing after successful save#397
Lp-Francois wants to merge 1 commit into
cursor:mainfrom
Lp-Francois:fix/close-add-company-modal-on-save

Conversation

@Lp-Francois
Copy link
Copy Markdown

@Lp-Francois Lp-Francois commented May 26, 2026

What

  • close the Add Company modal when company save succeeds (right now it doesn't, which lead people to create several times the same company... see screenshot). Kind of related to my other PR: feat: add owner-only company deletion flow #396 (which allow deletion of these multiple companies 😅 )
Screenshot 2026-05-26 at 14 15 38
  • keep existing non-redirect refresh behavior by setting reload=true
  • switch query state handling in CompanyForm to update both reload and addCompany (addCompany controls the modal)

Why

When creating a company from /companies?addCompany=true, the modal stayed open after a successful save because addCompany was never reset to false. This leads people to think the save didn't happen.

Testing

  • bun run typecheck (from apps/cursor)

Note

Low Risk
Small UI/query-state change in one form component with no auth, data, or API logic changes.

Overview
Fixes the Add Company modal staying open after a successful save by clearing the addCompany URL query flag on success.

CompanyForm now uses useQueryStates instead of a single reload param. On upsertCompanyAction success it sets addCompany: false in all cases, and when not redirecting it still sets reload: true so the job form’s company list refreshes.

Reviewed by Cursor Bugbot for commit ec74ea4. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

@Lp-Francois is attempting to deploy a commit to the Anysphere Team on Vercel.

A member of the Team first needs to authorize it.

@Lp-Francois Lp-Francois changed the title Fix add-company modal not closing after successful save fix: add-company modal not closing after successful save May 26, 2026
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.

1 participant