MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / handleSwitch

Function handleSwitch

apps/cloud/src/web/components/org-menu-slot.tsx:58–62  ·  view source on GitHub ↗
(organization: { id: string; slug: string })

Source from the content-addressed store, hash-verified

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>,

Callers 1

Calls 1

trackEventFunction · 0.90

Tested by

no test coverage detected