Skip to content

Commit 8996d73

Browse files
better handling of unapproved projects (#3731)
1 parent dbca8a2 commit 8996d73

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/grant-explorer/src/features/round/ViewProjectDetails.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ export default function ViewProjectDetails() {
102102
applicationId = paramApplicationId;
103103
}
104104

105-
const { data: application, error } = useApplication(
105+
const {
106+
data: application,
107+
error,
108+
isLoading,
109+
} = useApplication(
106110
{
107111
chainId: Number(chainId as string),
108112
roundId,
@@ -230,7 +234,7 @@ export default function ViewProjectDetails() {
230234
),
231235
},
232236
],
233-
[stats, grants, projectToRender, description]
237+
[stats, grants, projectToRender, description, isLoading]
234238
);
235239

236240
const handleTabChange = (tabIndex: number) => {
@@ -283,7 +287,9 @@ export default function ViewProjectDetails() {
283287
/>
284288
)}
285289
<div className="flex-1">
286-
{error === undefined ? (
290+
{error === undefined &&
291+
!isLoading &&
292+
projectToRender !== undefined ? (
287293
<>
288294
<Skeleton isLoaded={Boolean(title)}>
289295
<h1 className="text-4xl font-modern-era-medium tracking-tight text-grey-500">
@@ -301,7 +307,7 @@ export default function ViewProjectDetails() {
301307
</div>
302308
</>
303309
) : (
304-
<p>Couldn't load project data.</p>
310+
<p>Couldn't load project data. It may not exist.</p>
305311
)}
306312
</div>
307313
</div>

0 commit comments

Comments
 (0)