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 get-random-key.ts

Kiran K80a42ca93cff
diff --git a/apps/web/lib/planetscale/get-random-key.ts b/apps/web/lib/planetscale/get-random-key.ts
index a7e6434443..06e27fae45 100644
--- a/apps/web/lib/planetscale/get-random-key.ts
+++ b/apps/web/lib/planetscale/get-random-key.ts
@@ -16,7 +16,9 @@ export async function getRandomKey({
if (prefix) {
key = `${prefix.replace(/^\/|\/$/g, "")}/${key}`;
}
+
const exists = await checkIfKeyExists({ domain, key });
+
if (exists) {
// by the off chance that key already exists
return getRandomKey({ domain, prefix, long });