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.

small fixes

Steven Teyb52368422391
diff --git a/apps/web/lib/zod/schemas/clicks.ts b/apps/web/lib/zod/schemas/clicks.ts
index ce67e654de..37746c65cc 100644
--- a/apps/web/lib/zod/schemas/clicks.ts
+++ b/apps/web/lib/zod/schemas/clicks.ts
@@ -20,6 +20,7 @@ export const clickEventSchemaTB = z.object({
browser_version: z.string().nullable(),
os: z.string().nullable(),
os_version: z.string().nullable(),
+ trigger: z.string().nullish(), // special case in case it's not present
engine: z.string().nullable(),
engine_version: z.string().nullable(),
cpu_architecture: z.string().nullable(),
@@ -64,7 +65,7 @@ export const clickEventSchema = z.object({
device: z.string(),
browser: z.string(),
os: z.string(),
- trigger: z.string(),
+ trigger: z.string().nullish(), // special case in case it's not present
referer: z.string(),
refererUrl: z.string(),
qr: z.coerce.boolean(),
diff --git a/apps/web/ui/analytics/device-icon.tsx b/apps/web/ui/analytics/device-icon.tsx
index 2d4b28bd89..996d52aa96 100644
--- a/apps/web/ui/analytics/device-icon.tsx
+++ b/apps/web/ui/analytics/device-icon.tsx
@@ -4,16 +4,15 @@ import { BlurImage } from "@dub/ui";
import {
AppleLogo,
Cube,
- CursorRays,
Desktop,
GamingConsole,
MobilePhone,
- QRCode,
TV,
Tablet,
Watch,
Window,
} from "@dub/ui/icons";
+import { TRIGGER_DISPLAY } from "./trigger-display";
export default function DeviceIcon({
display,
@@ -89,11 +88,8 @@ export default function DeviceIcon({
);
}
} else if (tab === "triggers") {
- if (display === "qr") {
- return <QRCode className={className} />;
- } else {
- return <CursorRays className={className} />;
- }
+ const { icon: Icon } = TRIGGER_DISPLAY[display];
+ return <Icon className={className} />;
} else {
return (
<BlurImage
diff --git a/apps/web/ui/analytics/devices.tsx b/apps/web/ui/analytics/devices.tsx
index 2302c5898c..e601a1c4d4 100644
--- a/apps/web/ui/analytics/devices.tsx
+++ b/apps/web/ui/analytics/devices.tsx
@@ -18,7 +18,7 @@ export default function Devices() {
const dataKey = selectedTab === "sales" ? saleUnit : "count";
const [tab, setTab] = useState<DeviceTabs>("devices");
- const { data, loading } = useAnalyticsFilterOption(tab);
+ const { data } = useAnalyticsFilterOption(tab);
const singularTabName = SINGULAR_ANALYTICS_ENDPOINTS[tab];
return (