Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Try/catch URL parsing of referrer (#4511)

authored by

Samuel Newman and committed by
GitHub
bdeac28d d9066a6b

+13 -6
+13 -6
src/lib/statsig/statsig.tsx
··· 43 43 refUrl = decodeURIComponent(params.get('ref_url') ?? '') 44 44 } 45 45 46 - if (isWeb && typeof document !== 'undefined' && document != null) { 47 - const url = new URL(document.referrer) 48 - if (url.hostname !== 'bsky.app') { 49 - referrer = document.referrer 50 - referrerHostname = url.hostname 51 - } 46 + if ( 47 + isWeb && 48 + typeof document !== 'undefined' && 49 + document != null && 50 + document.referrer 51 + ) { 52 + try { 53 + const url = new URL(document.referrer) 54 + if (url.hostname !== 'bsky.app') { 55 + referrer = document.referrer 56 + referrerHostname = url.hostname 57 + } 58 + } catch {} 52 59 } 53 60 54 61 export type {LogEvents}