Fixed website undefined issue.

This commit is contained in:
Mike Cao 2023-05-16 19:40:02 -07:00
parent b663146ad5
commit c567eddff9

View File

@ -9,9 +9,9 @@ export default function RealtimeDetailsPage() {
const { id: websiteId } = router.query; const { id: websiteId } = router.query;
const { formatMessage, labels } = useMessages(); const { formatMessage, labels } = useMessages();
const { get, useQuery } = useApi(); const { get, useQuery } = useApi();
const { data: website } = useQuery(['websites', websiteId], () => const { data: website } = useQuery(['websites', websiteId], () => get(`/websites/${websiteId}`), {
websiteId ? get(`/websites/${websiteId}`, { enabled: !!websiteId }) : null, enabled: !!websiteId,
); });
const title = `${formatMessage(labels.realtime)}${website?.name ? ` - ${website.name}` : ''}`; const title = `${formatMessage(labels.realtime)}${website?.name ? ` - ${website.name}` : ''}`;
if (!websiteId) { if (!websiteId) {