From b663146ad5ef654937b861bfb096037f885ad692 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Tue, 16 May 2023 19:31:40 -0700 Subject: [PATCH 1/2] Fixed data being undefined. --- components/metrics/MetricsTable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/metrics/MetricsTable.js b/components/metrics/MetricsTable.js index a918c0fb..50262798 100644 --- a/components/metrics/MetricsTable.js +++ b/components/metrics/MetricsTable.js @@ -73,13 +73,13 @@ export function MetricsTable({ const filteredData = useMemo(() => { if (data) { - let items; + let items = data; if (dataFilter) { if (Array.isArray(dataFilter)) { items = dataFilter.reduce((arr, filter) => { return filter(arr); - }, data); + }, items); } else { items = dataFilter(data); } From c567eddff99c518cc128a3668d5762354898c096 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Tue, 16 May 2023 19:40:02 -0700 Subject: [PATCH 2/2] Fixed website undefined issue. --- pages/realtime/[id]/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/realtime/[id]/index.js b/pages/realtime/[id]/index.js index ba13ded3..c9e82622 100644 --- a/pages/realtime/[id]/index.js +++ b/pages/realtime/[id]/index.js @@ -9,9 +9,9 @@ export default function RealtimeDetailsPage() { const { id: websiteId } = router.query; const { formatMessage, labels } = useMessages(); const { get, useQuery } = useApi(); - const { data: website } = useQuery(['websites', websiteId], () => - websiteId ? get(`/websites/${websiteId}`, { enabled: !!websiteId }) : null, - ); + const { data: website } = useQuery(['websites', websiteId], () => get(`/websites/${websiteId}`), { + enabled: !!websiteId, + }); const title = `${formatMessage(labels.realtime)}${website?.name ? ` - ${website.name}` : ''}`; if (!websiteId) {