diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-03-17 15:20:34 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-03-17 15:20:34 -0500 |
commit | 6af2585f3232fedd1864ff187bae0153967c7f38 (patch) | |
tree | cde395a09b2b4eac8f8e603f6045f809c30ee500 | |
parent | 308b1e8beb79170c7caae2f9d9b9fc898ae7813c (diff) | |
download | voidsky-6af2585f3232fedd1864ff187bae0153967c7f38.tar.zst |
Choose good stuff based on service
-rw-r--r-- | src/lib/constants.ts | 10 | ||||
-rw-r--r-- | src/state/models/feed-view.ts | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 0cde9b014..ffc1aaed5 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -161,6 +161,16 @@ export function SUGGESTED_FOLLOWS(serviceUrl: string) { } } +export function GOOD_STUFF(serviceUrl: string) { + if (serviceUrl.includes('localhost')) { + return 'alice.test' + } else if (serviceUrl.includes('staging')) { + return 'paul.staging.bsky.dev' + } else { + return 'jay.bsky.social' + } +} + export const POST_IMG_MAX_WIDTH = 2000 export const POST_IMG_MAX_HEIGHT = 2000 export const POST_IMG_MAX_SIZE = 1000000 diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts index a62dbc983..3d7680fbc 100644 --- a/src/state/models/feed-view.ts +++ b/src/state/models/feed-view.ts @@ -16,7 +16,7 @@ import {RootStoreModel} from './root-store' import * as apilib from 'lib/api/index' import {cleanError} from 'lib/strings/errors' import {RichText} from 'lib/strings/rich-text' -import {SUGGESTED_FOLLOWS} from 'lib/constants' +import {SUGGESTED_FOLLOWS, GOOD_STUFF} from 'lib/constants' import { getCombinedCursors, getMultipleAuthorsPosts, @@ -643,7 +643,7 @@ export class FeedModel { } else if (this.feedType === 'goodstuff') { const res = await this.rootStore.api.app.bsky.feed.getAuthorFeed({ ...params, - author: 'jay.bsky.social', + author: GOOD_STUFF(String(this.rootStore.agent.service)), } as GetAuthorFeed.QueryParams) res.data.feed = mergePosts([res], {repostsOnly: true}) res.data.feed.forEach(item => { |