diff --git a/src/components/crew/CordnNativePanel.tsx b/src/components/crew/CordnNativePanel.tsx index 5d6a331..46a4116 100644 --- a/src/components/crew/CordnNativePanel.tsx +++ b/src/components/crew/CordnNativePanel.tsx @@ -38,6 +38,7 @@ import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useUploadFile } from '@/hooks/useUploadFile'; import { useCordnNative } from '@/hooks/useCordnNative'; import { shortNpub } from '@/lib/coordinator'; +import { isNativePlatform } from '@/lib/platform'; import { formatDistanceToNow } from '@/lib/dateFnsI18n'; import { cn } from '@/lib/utils'; import type { SkateCrew } from '@/lib/types'; @@ -83,10 +84,13 @@ export function CordnNativePanel({ crew, canManage, isMember }: CordnNativePanel const loadedRequestsRef = useRef(false); const { mutateAsync: uploadFile, isPending: uploading } = useUploadFile(); - const inviteUrl = useMemo( - () => `${window.location.origin}/#/crew/${crew.pubkey}/${crew.identifier}?tab=mls`, - [crew.pubkey, crew.identifier], - ); + const inviteUrl = useMemo(() => { + // In the Android/iOS shell the page origin is `https://localhost`, which is + // useless in a QR code. Share the public site there; keep the live origin on + // the web (including previews). + const origin = isNativePlatform() ? 'https://skate-spots.org' : window.location.origin; + return `${origin}/#/crew/${crew.pubkey}/${crew.identifier}?tab=mls`; + }, [crew.pubkey, crew.identifier]); useEffect(() => { scrollRef.current?.scrollTo({ top: scrollRef.current.scrollHeight });