Skip to content

Commit 301c97b

Browse files
committed
fix: outbound links
1 parent 2dab233 commit 301c97b

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

apps/dashboard/app/(main)/websites/[id]/_components/tabs/overview/_components/custom-events-section.tsx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ export function CustomEventsSection({
265265
description="User-defined events, interactions, and outbound link tracking"
266266
expandable
267267
getSubRows={(row: ProcessedCustomEvent): any[] => {
268+
if (!row.properties || typeof row.properties !== 'object') {
269+
return [];
270+
}
268271
const propertyKeys = Object.keys(row.properties);
269272
return propertyKeys.map(
270273
(key): PropertySubRow => ({
@@ -367,10 +370,12 @@ export function CustomEventsSection({
367370
{
368371
id: 'outbound_links',
369372
label: 'Outbound Links',
370-
data: (customEventsData.outbound_links || []).map((link) => ({
371-
...link,
372-
name: link.href,
373-
})),
373+
data: (customEventsData.outbound_links || [])
374+
.filter((link) => link && typeof link === 'object' && link.href)
375+
.map((link) => ({
376+
...link,
377+
name: link.href,
378+
})),
374379
columns: outboundLinksColumns,
375380
getFilter: (row: OutboundLinkData) => ({
376381
field: 'href',
@@ -380,10 +385,14 @@ export function CustomEventsSection({
380385
{
381386
id: 'outbound_domains',
382387
label: 'Outbound Domains',
383-
data: (customEventsData.outbound_domains || []).map((domain) => ({
384-
...domain,
385-
name: domain.domain,
386-
})),
388+
data: (customEventsData.outbound_domains || [])
389+
.filter(
390+
(domain) => domain && typeof domain === 'object' && domain.domain
391+
)
392+
.map((domain) => ({
393+
...domain,
394+
name: domain.domain,
395+
})),
387396
columns: outboundDomainsColumns,
388397
getFilter: (row: OutboundDomainData) => ({
389398
field: 'href',

0 commit comments

Comments
 (0)