Fix flash loading response viewer

This commit is contained in:
Gregory Schier
2024-06-17 11:43:45 -07:00
parent ee776143b2
commit 5b2162e48d
5 changed files with 20 additions and 13 deletions

View File

@@ -9,12 +9,15 @@ interface Props {
}
export function JsonViewer({ response, className }: Props) {
const rawBody = useResponseBodyText(response) ?? '';
const rawBody = useResponseBodyText(response);
if (rawBody.isLoading || rawBody.data == null) return null;
let parsed = {};
try {
parsed = JSON.parse(rawBody);
parsed = JSON.parse(rawBody.data);
} catch (e) {
// foo
// Nothing yet
}
return (