Skip to content

Commit

Permalink
Merge pull request #779 from wri/fix/TM-1590-start-site-report
Browse files Browse the repository at this point in the history
[TM-1590] Wait to mount the entity form until the entity has finished loading
  • Loading branch information
roguenet authored Dec 24, 2024
2 parents 348b037 + d5bdafc commit f137da4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/entity/[entityName]/edit/[uuid]/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const EditEntityPage = () => {
const entityName = router.query.entityName as EntityName;
const entityUUID = router.query.uuid as string;

const { data: entityData } = useGetV2ENTITYUUID({
const { data: entityData, isLoading: getEntityLoading } = useGetV2ENTITYUUID({
pathParams: { entity: entityName, uuid: entityUUID }
});
const entity = entityData?.data ?? {}; //Do not abuse this since forms should stay entity agnostic!
Expand All @@ -37,7 +37,7 @@ const EditEntityPage = () => {
return (
<BackgroundLayout>
<FrameworkProvider frameworkKey={entity.framework_key}>
<LoadingContainer loading={isLoading}>
<LoadingContainer loading={isLoading || getEntityLoading}>
<EditEntityForm {...{ entityName, entityUUID, entity, formData }} />
</LoadingContainer>
<br />
Expand Down

0 comments on commit f137da4

Please sign in to comment.