mirror of
https://github.com/Kong/insomnia.git
synced 2026-09-17 08:59:33 -04:00
`getInitialEntry()` restores `lastVisitedOrganizationId` on startup and resolves an initial pathname for it, entirely independent of the Konnect visibility state that `refreshKonnectAccess()` (called right before it in entry.client.tsx) just recomputed. When the Konnect organization has no projects, `getInitialRouteForOrganization` falls back straight to `/organization/<id>/project` — a leaf route whose own loader was never wired up with the `getKonnectOrganizationEscapeRoute` check (only the org-index loader and the project-delete action were). So an account that loses Konnect access (or synced projects) while the app is closed reopens with the URL still pointing at Control Planes, even though the organization has already disappeared from the dropdown. Reuse `getKonnectOrganizationEscapeRoute` here too: when the resolved organizationId is the Konnect organization, re-validate it before computing a route inside it, and land on the account's first real organization instead if it just went dark. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>