Skip to content

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

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

fix: add-company modal not closing after successful save#397
Lp-Francois wants to merge 0 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 query-param and modal state fix on the companies form with no auth or data-layer changes.

Overview
Fixes the Add Company modal staying open after a successful save when opened via /companies?addCompany=true.

On success, CompanyForm now clears the addCompany query flag (which drives the modal) while still setting reload=true so the companies list refreshes without a full redirect. Previously only reload was updated, so users often saved again and created duplicate companies.

Reviewed by Cursor Bugbot for commit 8108ed5. 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
@Lp-Francois Lp-Francois force-pushed the fix/close-add-company-modal-on-save branch from ec74ea4 to 8108ed5 Compare May 28, 2026 07:39
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