fix metrics

This commit is contained in:
Lee 2024-04-18 12:49:38 +01:00
parent 2053f7baef
commit 081c0c9f92

@ -51,8 +51,7 @@ const stats: Stat[] = [
export function Stats(): ReactElement {
const { lastMessage, readyState } = useWebSocket("wss://api.mcutils.xyz/websocket/metrics");
const metrics =
lastMessage !== null && readyState == ReadyState.OPEN ? JSON.parse(lastMessage.data).metrics : undefined;
const metrics = lastMessage !== null && readyState == ReadyState.OPEN ? JSON.parse(lastMessage.data) : undefined;
return (
<div className="flex gap-2 flex-wrap justify-center">