Skip to content

Commit 5e5ef68

Browse files
authored
fix(dashboard): add optional chaining to shipping lines to prevent UI from crashing (#3930)
1 parent 7274b23 commit 5e5ef68

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/dashboard/src/app/routes/_authenticated/_orders/orders.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function OrderListPage() {
8585
header: () => <Trans>Shipping</Trans>,
8686
cell: ({ row }) => {
8787
const value = row.original.shippingLines;
88-
return <div>{value.map(line => line.shippingMethod.name).join(', ')}</div>;
88+
return <div>{value?.map(line => line.shippingMethod.name).join(', ')}</div>;
8989
},
9090
},
9191
}}

packages/dashboard/src/lib/components/ui/tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function TooltipContent({
3636
data-slot="tooltip-content"
3737
sideOffset={sideOffset}
3838
className={cn(
39-
'bg-secondary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-w-sm rounded-md px-3 py-1.5 text-xs',
39+
'bg-secondary text-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-w-sm rounded-md px-3 py-1.5 text-xs',
4040
className,
4141
)}
4242
{...props}

0 commit comments

Comments
 (0)