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.

use window.location.origin for logo

Steven Tey50aebacf179b
diff --git a/components/app/modals/link-qr-modal.tsx b/components/app/modals/link-qr-modal.tsx
index 33d5b95143..67a128b158 100644
--- a/components/app/modals/link-qr-modal.tsx
+++ b/components/app/modals/link-qr-modal.tsx
@@ -42,14 +42,13 @@ function LinkQRModalHelper({
() => linkConstructor({ key: props.key, domain }),
[props, domain]
);
+
const qrLogoUrl = useMemo(() => {
if (logo) return logo;
- if (process.env.NEXT_PUBLIC_VERCEL_ENV) {
- return "https://dub.sh/static/logo.svg";
- } else {
- return "http://localhost:3000/static/logo.svg";
- }
- }, [logo]);
+ return typeof window !== "undefined" && window.location.origin
+ ? new URL("/static/logo.svg", window.location.origin).href
+ : "";
+ }, []);
function download(url: string, extension: string) {
if (!anchorRef.current) return;