Fix premature pin on failed profile add#39
Merged
ghostleek merged 2 commits intofix/show-profilefrom Mar 4, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update profile management UI and fix Opal logo issue
Fix premature pin on failed profile add
Mar 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents the homepage pin state from being updated when adding an existing app to a personal profile fails, ensuring UI state reflects the actual server-side outcome.
Changes:
- Reorders
handleAddExistingAppso the profile add API call is awaited before pinning. - Keeps the existing “only pin if not already pinned” behavior, but now only after a successful add.
- Preserves existing success/failure toast behavior and profile reload on success.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
handleAddExistingAppwas callingtogglePinnedAppbefore awaiting the/api/profile/add-appresponse. On API failure, the app stayed pinned on the homepage despite never being added to the profile.Change
Move
togglePinnedAppto execute only afteraddAppToProfilereturnstrue:Pin state is now only updated when the API call confirms the app was successfully added to the profile.
💡 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.