Skip to content

Commit

Permalink
refactor: fix conditions for checking env var
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonlunn committed Dec 7, 2024
1 parent 071b60c commit f912389
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app/(default)/components/SharePageURLButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ 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.NEXT_PUBLIC_VERCEL_URL != null ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}` : 'http://localhost:3000'
console.log(process.env.NEXT_PUBLIC_VERCEL_URL)
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL !== '' && process.env.NEXT_PUBLIC_VERCEL_URL != null ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}` : 'http://localhost:3000'
const optionalSlug = slug !== '' ? `/${slug}` : ''
const url = `${baseUrl}${path}${optionalSlug}`

Expand Down

0 comments on commit f912389

Please sign in to comment.