Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Make ref_ always strings (#3583)

* Make ref_ always strings

* Harden types

authored by

dan and committed by
GitHub
71c427ce 48bd98f9

+18 -6
+18 -6
src/lib/statsig/statsig.tsx
··· 15 15 import {LogEvents} from './events' 16 16 import {Gate} from './gates' 17 17 18 - let refSrc: string 19 - let refUrl: string 18 + type StatsigUser = { 19 + userID: string | undefined 20 + // TODO: Remove when enough users have custom.platform: 21 + platform: 'ios' | 'android' | 'web' 22 + custom: { 23 + // This is the place where we can add our own stuff. 24 + // Fields here have to be non-optional to be visible in the UI. 25 + platform: 'ios' | 'android' | 'web' 26 + refSrc: string 27 + refUrl: string 28 + } 29 + } 30 + 31 + let refSrc = '' 32 + let refUrl = '' 20 33 if (isWeb && typeof window !== 'undefined') { 21 34 const params = new URLSearchParams(window.location.search) 22 35 refSrc = params.get('ref_src') ?? '' ··· 97 110 return initialValue 98 111 } 99 112 100 - function toStatsigUser(did: string | undefined) { 113 + function toStatsigUser(did: string | undefined): StatsigUser { 101 114 let userID: string | undefined 102 115 if (did) { 103 116 userID = sha256(did) 104 117 } 105 118 return { 106 119 userID, 107 - platform: Platform.OS, 120 + platform: Platform.OS as 'ios' | 'android' | 'web', 108 121 custom: { 109 122 refSrc, 110 123 refUrl, 111 - // Need to specify here too for gating. 112 - platform: Platform.OS, 124 + platform: Platform.OS as 'ios' | 'android' | 'web', 113 125 }, 114 126 } 115 127 }