diff --git a/src/components/ShareProfileDialog.tsx b/src/components/ShareProfileDialog.tsx index fb501c6..51709c2 100644 --- a/src/components/ShareProfileDialog.tsx +++ b/src/components/ShareProfileDialog.tsx @@ -25,10 +25,11 @@ export function ShareProfileDialog({ open, onOpenChange, npub, displayName }: Sh const [qr, setQr] = useState(null); const [copied, setCopied] = useState(false); - // Prefer the deployed public URL so the link works anywhere; fall back to the - // current origin (dev / self-hosted). - const origin = typeof window !== 'undefined' ? window.location.origin : 'https://skate-spots.org'; - const shareUrl = `${origin}/${npub}`; + // Always anchor to the canonical public site so shared links/QRs point to the + // real domain — never the preview/sandbox iframe host that window.location + // would give us inside the editor. + const CANONICAL_ORIGIN = 'https://skate-spots.org'; + const shareUrl = `${CANONICAL_ORIGIN}/${npub}`; useEffect(() => { if (!open) return; @@ -71,10 +72,10 @@ export function ShareProfileDialog({ open, onOpenChange, npub, displayName }: Sh return ( - - + + - + Share profile @@ -83,12 +84,12 @@ export function ShareProfileDialog({ open, onOpenChange, npub, displayName }: Sh {/* QR */} -
+
{qr ? ( - Profile QR code + Profile QR code ) : ( -
+
)} @@ -97,7 +98,7 @@ export function ShareProfileDialog({ open, onOpenChange, npub, displayName }: Sh {/* URL + copy */}