fix scratchpad not being redirected properly (#6854)

This commit is contained in:
James Gatz 2023-11-22 18:52:21 +01:00 committed by GitHub
parent a746d5711d
commit 9d0823597d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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