Skip to content

Commit f2e5794

Browse files
authored
fix: reorder render to fix project error -- Rendered fewer hooks tha… (#7073)
1 parent 62c3ece commit f2e5794

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

packages/web/app/src/pages/organization.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,6 @@ function OrganizationPageContent(
348348
});
349349
}, [projectsConnection, props.search, sortKey, sortOrder]);
350350

351-
if (query.error) {
352-
return <QueryError organizationSlug={props.organizationSlug} error={query.error} />;
353-
}
354-
355351
const onSearchChange = useCallback(
356352
(event: ChangeEvent<HTMLInputElement>) => {
357353
void router.navigate({
@@ -392,6 +388,10 @@ function OrganizationPageContent(
392388
});
393389
}, [router, props.sortOrder]);
394390

391+
if (query.error) {
392+
return <QueryError organizationSlug={props.organizationSlug} error={query.error} />;
393+
}
394+
395395
return (
396396
<OrganizationLayout
397397
page={Page.Overview}

packages/web/app/src/pages/project.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,6 @@ const ProjectsPageContent = (
304304
return 100;
305305
}, [targetConnection?.edges]);
306306

307-
if (query.error) {
308-
return (
309-
<QueryError
310-
organizationSlug={props.organizationSlug}
311-
error={query.error}
312-
showLogoutButton={false}
313-
/>
314-
);
315-
}
316-
317307
const onSearchChange = useCallback(
318308
(event: ChangeEvent<HTMLInputElement>) => {
319309
void router.navigate({
@@ -354,6 +344,16 @@ const ProjectsPageContent = (
354344
});
355345
}, [router, props.sortOrder]);
356346

347+
if (query.error) {
348+
return (
349+
<QueryError
350+
organizationSlug={props.organizationSlug}
351+
error={query.error}
352+
showLogoutButton={false}
353+
/>
354+
);
355+
}
356+
357357
return (
358358
<div className="grow">
359359
<div className="flex flex-row items-center justify-between py-6">

0 commit comments

Comments
 (0)