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.

added Vercel Analytics, fixed cron bug

Steven Tey62578b4b1d72
diff --git a/lib/cron/usage.tsx b/lib/cron/usage.tsx
index 96422a530b..472be561ef 100644
--- a/lib/cron/usage.tsx
+++ b/lib/cron/usage.tsx
@@ -46,7 +46,7 @@ export const updateUsage = async () => {
sentEmails: true,
},
orderBy: {
- usageUpdatedAt: "desc",
+ usageUpdatedAt: "asc",
},
take: 50,
});
diff --git a/package.json b/package.json
index 6101943306..5316fe48b8 100644
--- a/package.json
+++ b/package.json
@@ -24,6 +24,7 @@
"@upstash/qstash": "^0.1.7",
"@upstash/ratelimit": "^0.1.5",
"@upstash/redis": "^1.12.0",
+ "@vercel/analytics": "^0.0.3",
"@visx/axis": "^2.12.2",
"@visx/event": "^2.6.0",
"@visx/geo": "^2.10.0",
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 9faaece73f..c3fb13faab 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -1,4 +1,5 @@
import type { AppProps } from "next/app";
+import { Analytics } from "@vercel/analytics/react";
import type { Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import PlausibleProvider from "next-plausible";
@@ -9,11 +10,14 @@ function MyApp({
pageProps: { session, ...pageProps },
}: AppProps<{ session: Session }>) {
return (
- <PlausibleProvider domain="dub.sh">
- <SessionProvider session={session}>
- <Component {...pageProps} />
- </SessionProvider>
- </PlausibleProvider>
+ <>
+ <Analytics />
+ <PlausibleProvider domain="dub.sh">
+ <SessionProvider session={session}>
+ <Component {...pageProps} />
+ </SessionProvider>
+ </PlausibleProvider>
+ </>
);
}
diff --git a/yarn.lock b/yarn.lock
index 10438bebd4..da4d1f5b34 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1580,6 +1580,11 @@
dependencies:
isomorphic-fetch "^3.0.0"
+"@vercel/analytics@^0.0.3":
+ version "0.0.3"
+ resolved "https://registry.yarnpkg.com/@vercel/analytics/-/analytics-0.0.3.tgz#4b487966fffd132ee6adfc1cfbc9590624c4c1a3"
+ integrity sha512-lj7j9sX7KEj3hd1x7dJeCzBSVsYos4U4vj/DznFibaTQu/mHVRsKv/D18qIXqk8lkCkWxIGsjq9au3y3CB78Ag==
+
"@visx/axis@^2.12.2":
version "2.12.2"
resolved "https://registry.npmjs.org/@visx/axis/-/axis-2.12.2.tgz"