Bluesky app fork with some witchin' additions 💫

Merge branch 'main' of github.com:bluesky-social/social-app into main

+13 -2
+3 -1
src/lib/statsig/events.ts
··· 10 10 logContext: 'SwitchAccount' | 'Settings' | 'Deactivated' 11 11 } 12 12 'notifications:openApp': {} 13 - 'state:background': {} 13 + 'state:background': { 14 + secondsActive: number 15 + } 14 16 'state:foreground': {} 15 17 'feed:endReached': { 16 18 feedType: string
+10 -1
src/lib/statsig/statsig.tsx
··· 67 67 } 68 68 69 69 let lastState: AppStateStatus = AppState.currentState 70 + let lastActive = lastState === 'active' ? performance.now() : null 70 71 AppState.addEventListener('change', (state: AppStateStatus) => { 71 72 if (state === lastState) { 72 73 return 73 74 } 74 75 lastState = state 75 76 if (state === 'active') { 77 + lastActive = performance.now() 76 78 logEvent('state:foreground', {}) 77 79 } else { 78 - logEvent('state:background', {}) 80 + let secondsActive = 0 81 + if (lastActive != null) { 82 + secondsActive = Math.round((performance.now() - lastActive) / 1e3) 83 + } 84 + lastActive = null 85 + logEvent('state:background', { 86 + secondsActive, 87 + }) 79 88 } 80 89 }) 81 90