Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

tweaks to constants (#7478)

* add did

* use correct did

* typo

* tweak

authored by

Hailey and committed by
GitHub
6f3f1167 ec9cafdb

+25 -4
+15
src/lib/constants.ts
··· 63 63 export const PROD_DEFAULT_FEED = (rkey: string) => 64 64 `at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/${rkey}` 65 65 66 + export const STAGING_DEFAULT_FEED = (rkey: string) => 67 + `at://did:plc:yofh3kx63drvfljkibw5zuxo/app.bsky.feed.generator/${rkey}` 68 + 69 + export const PROD_FEEDS = [ 70 + `feedgen|${PROD_DEFAULT_FEED('whats-hot')}`, 71 + `feedgen|${PROD_DEFAULT_FEED('thevids')}`, 72 + ] 73 + 74 + export const STAGING_FEEDS = [ 75 + `feedgen|${STAGING_DEFAULT_FEED('whats-hot')}`, 76 + `feedgen|${STAGING_DEFAULT_FEED('thevids')}`, 77 + ] 78 + 79 + export const FEEDBACK_FEEDS = [...PROD_FEEDS, ...STAGING_FEEDS] 80 + 66 81 export const POST_IMG_MAX = { 67 82 width: 2000, 68 83 height: 2000,
+10 -4
src/state/feed-feedback.tsx
··· 3 3 import {AppBskyFeedDefs} from '@atproto/api' 4 4 import throttle from 'lodash.throttle' 5 5 6 - import {PROD_DEFAULT_FEED} from '#/lib/constants' 6 + import {FEEDBACK_FEEDS, STAGING_FEEDS} from '#/lib/constants' 7 7 import {logEvent} from '#/lib/statsig/statsig' 8 8 import {logger} from '#/logger' 9 9 import {FeedDescriptor, FeedPostSliceItem} from '#/state/queries/post-feed' ··· 25 25 export function useFeedFeedback(feed: FeedDescriptor, hasSession: boolean) { 26 26 const agent = useAgent() 27 27 const enabled = isDiscoverFeed(feed) && hasSession 28 + 28 29 const queue = React.useRef<Set<string>>(new Set()) 29 30 const history = React.useRef< 30 31 // Use a WeakSet so that we don't need to clear it. ··· 46 47 const interactions = Array.from(queue.current).map(toInteraction) 47 48 queue.current.clear() 48 49 50 + let proxyDid = 'did:web:discover.bsky.app' 51 + if (STAGING_FEEDS.includes(feed)) { 52 + proxyDid = 'did:web:algo.pop2.bsky.app' 53 + } 54 + 49 55 // Send to the feed 50 56 agent.app.bsky.feed 51 57 .sendInteractions( ··· 54 60 encoding: 'application/json', 55 61 headers: { 56 62 // TODO when we start sending to other feeds, we need to grab their DID -prf 57 - 'atproto-proxy': 'did:web:discover.bsky.app#bsky_fg', 63 + 'atproto-proxy': `${proxyDid}#bsky_fg`, 58 64 }, 59 65 }, 60 66 ) ··· 68 74 } 69 75 sendOrAggregateInteractionsForStats(aggregatedStats.current, interactions) 70 76 throttledFlushAggregatedStats() 71 - }, [agent, throttledFlushAggregatedStats]) 77 + }, [agent, throttledFlushAggregatedStats, feed]) 72 78 73 79 const sendToFeed = React.useMemo( 74 80 () => ··· 155 161 // place, we're hardcoding it to the discover feed. 156 162 // -prf 157 163 function isDiscoverFeed(feed: FeedDescriptor) { 158 - return feed === `feedgen|${PROD_DEFAULT_FEED('whats-hot')}` 164 + return FEEDBACK_FEEDS.includes(feed) 159 165 } 160 166 161 167 function toString(interaction: AppBskyFeedDefs.Interaction): string {