Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update toggle.tsx

Tim Wilsona5bcedd0c369
diff --git a/apps/web/ui/analytics/toggle.tsx b/apps/web/ui/analytics/toggle.tsx
index 4368f39c81..83a6f76b63 100644
--- a/apps/web/ui/analytics/toggle.tsx
+++ b/apps/web/ui/analytics/toggle.tsx
@@ -204,13 +204,14 @@ export default function Toggle() {
icon: Tag,
label: "Tag",
getOptionIcon: (value, { option }) => {
- const tag =
- option?.data?.color ?? tags?.find(({ id }) => id === value);
- return tag ? (
+ const tagColor =
+ option?.data?.color ??
+ tags?.find(({ id }) => id === value)?.color;
+ return tagColor ? (
<div
className={cn(
"rounded-md p-1.5",
- COLORS_LIST.find(({ color }) => color === tag.color)?.css,
+ COLORS_LIST.find(({ color }) => color === tagColor)?.css,
)}
>
<Tag className="h-2.5 w-2.5" />