(organization: { id: string; slug: string })
| 56 | // `x-executor-organization` header). No cookie to rewrite, no server switch |
| 57 | // call — just land on the other org's URL root and the whole app re-scopes. |
| 58 | const handleSwitch = (organization: { id: string; slug: string }) => { |
| 59 | if (organization.id === props.activeOrganizationId) return; |
| 60 | trackEvent("org_switched", { success: true }); |
| 61 | window.location.href = `/${organization.slug}`; |
| 62 | }; |
| 63 | |
| 64 | return AsyncResult.match(organizations, { |
| 65 | onInitial: () => <DropdownMenuItem disabled>Loading…</DropdownMenuItem>, |
no test coverage detected