diff --git a/packages/insomnia/src/ui/routes/organization.tsx b/packages/insomnia/src/ui/routes/organization.tsx index 92ed827bc..b8054a1cb 100644 --- a/packages/insomnia/src/ui/routes/organization.tsx +++ b/packages/insomnia/src/ui/routes/organization.tsx @@ -282,12 +282,6 @@ export interface FeatureList { export const singleOrgLoader: LoaderFunction = async ({ params }) => { const { organizationId } = params as { organizationId: string }; - const organization = organizationsData.organizations.find(o => o.id === organizationId); - - if (!organization) { - return redirect('/organization'); - } - const fallbackFeatures = { gitSync: { enabled: false, reason: 'Insomnia API unreachable' }, orgBasicRbac: { enabled: false, reason: 'Insomnia API unreachable' }, @@ -299,6 +293,12 @@ export const singleOrgLoader: LoaderFunction = async ({ params }) => { }; } + const organization = organizationsData.organizations.find(o => o.id === organizationId); + + if (!organization) { + return redirect('/organization'); + } + try { const response = await window.main.insomniaFetch<{ features: FeatureList } | undefined>({ method: 'GET',