fix(app): show insight not found instead of loading (#6593)

This commit is contained in:
jdolle 2025-03-09 17:44:24 -07:00 committed by GitHub
parent ec1238d14f
commit ef1efbb8c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'hive': patch
---
Fix operation insights showing loading for missing operations

View file

@ -33,7 +33,7 @@ function GraphQLOperationBody(props: {
return <GraphQLHighlight className="pt-6" code={operation.body} />;
}
return <div>Loading...</div>;
return <div>Operation not found.</div>;
}
const Operation_View_OperationBodyQuery = graphql(`
@ -147,7 +147,11 @@ function OperationView({
)}
<div className="mt-12 w-full rounded-md border border-gray-800 bg-gray-900/50 p-5">
<Section.Title>Operation body</Section.Title>
<GraphQLOperationBody operation={result.data?.target?.operation ?? null} />
{result.fetching ? (
<div>Loading...</div>
) : (
<GraphQLOperationBody operation={result.data?.target?.operation ?? null} />
)}
</div>
</>
);