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 route.tsx

Steven Tey646fd424a6b9
diff --git a/apps/web/app/api/qr/route.tsx b/apps/web/app/api/qr/route.tsx
index 99d5f80a76..52ba82b35f 100644
--- a/apps/web/app/api/qr/route.tsx
+++ b/apps/web/app/api/qr/route.tsx
@@ -21,11 +21,20 @@ export async function GET(req: NextRequest) {
const shortLink = await getShortLinkViaEdge(url.split("?")[0]);
if (shortLink) {
const workspace = await getWorkspaceViaEdge(shortLink.projectId);
+ // Free workspaces should always use the default logo.
if (!workspace || workspace.plan === "free") {
logo = DUB_QR_LOGO;
- } else if (workspace.logo && !hideLogo) {
+ /*
+ If:
+ - no logo is passed
+ - the workspace has a logo
+ - the hideLogo flag is not set
+ then we should use the workspace logo.
+ */
+ } else if (!logo && workspace.logo && !hideLogo) {
logo = workspace.logo;
}
+ // if the link is not on Dub, use the default logo.
} else {
logo = DUB_QR_LOGO;
}