Skip to content

fix: Extension is not switched to new account after creating it #1379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

juliopavila
Copy link
Member

Description:

Closes #1348
This PR addresses a persistent UX issue described in #1348, where the extension would not switch to the newly created account after the user completed the creation flow.

Context

The problem was caused by missing handling in useLaunchRoute for the case where a new route is created (i.e. the routeId differs from the current activeRouteId). While the onLaunch callback was invoked, no navigation was triggered, leaving the extension and UI in an inconsistent state.

Changes

  • Updated useLaunchRoute to differentiate between updating an existing account vs. creating a new one.
  • When a new route is detected, we now:
    • Invoke the onLaunch callback (as before),
    • Immediately navigate to the corresponding route.
  • For existing routes with pending transactions, we preserve the existing behavior and prompt for user confirmation.

Copy link

vercel bot commented Apr 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zodiac-pilot-companion-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2025 3:54pm

Copy link

supabase bot commented Apr 15, 2025

This pull request has been ignored for the connected project votjgopobsirzenzhufn because there are no changes detected in packages/db/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@juliopavila juliopavila changed the title fix: switch account after creating it fix: Extension is not switched to new account after creating it Apr 15, 2025
Copy link

github-actions bot commented Apr 15, 2025

Comment on lines +39 to +41
} else {
navigate(`/${activeRouteId}/clear-transactions/${routeId}`)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case should never happen. This would mean we're clearing transactions without the consent of the user. However, if we reach this point of the code, we can keep all transactions even if we switch the route because the target safe stays the same, or there are no transactions to clear. So navigate(/${routeId})` is the only viable option.

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.

Extension is not switched to new account after creating it
2 participants