diff --git a/.env b/.env index 415ac1936..e5797c3a0 100644 --- a/.env +++ b/.env @@ -21,6 +21,8 @@ NEXT_PUBLIC_CDN_URL=https://stg-media.openbeta.io NEXT_PUBLIC_API_SERVER=https://stg-api.openbeta.io +NEXT_PUBLIC_VERCEL_URL=$VERCEL_URL + # Disable telemetry NEXT_TELEMETRY_DISABLED=1 diff --git a/src/app/(default)/components/SharePageURLButton.tsx b/src/app/(default)/components/SharePageURLButton.tsx index 3cac7e520..ad6130cda 100644 --- a/src/app/(default)/components/SharePageURLButton.tsx +++ b/src/app/(default)/components/SharePageURLButton.tsx @@ -10,7 +10,8 @@ import { ControlledTooltip } from '@/components/ui/Tooltip' */ export const SharePageURLButton: React.FC<{ path: string, name: string }> = ({ path, name }) => { const slug = getFriendlySlug(name) - const baseUrl = process.env.VERCEL_URL != null ? `https://${process.env.VERCEL_URL}` : 'http://localhost:3000' + const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL != null ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}` : 'http://localhost:3000' + console.log(process.env.NEXT_PUBLIC_VERCEL_URL) const optionalSlug = slug !== '' ? `/${slug}` : '' const url = `${baseUrl}${path}${optionalSlug}`