Choose good stuff based on service

zio/stable
Paul Frazee 2023-03-17 15:20:34 -05:00
parent 308b1e8beb
commit 6af2585f32
2 changed files with 12 additions and 2 deletions

View File

@ -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_WIDTH = 2000
export const POST_IMG_MAX_HEIGHT = 2000 export const POST_IMG_MAX_HEIGHT = 2000
export const POST_IMG_MAX_SIZE = 1000000 export const POST_IMG_MAX_SIZE = 1000000

View File

@ -16,7 +16,7 @@ import {RootStoreModel} from './root-store'
import * as apilib from 'lib/api/index' import * as apilib from 'lib/api/index'
import {cleanError} from 'lib/strings/errors' import {cleanError} from 'lib/strings/errors'
import {RichText} from 'lib/strings/rich-text' import {RichText} from 'lib/strings/rich-text'
import {SUGGESTED_FOLLOWS} from 'lib/constants' import {SUGGESTED_FOLLOWS, GOOD_STUFF} from 'lib/constants'
import { import {
getCombinedCursors, getCombinedCursors,
getMultipleAuthorsPosts, getMultipleAuthorsPosts,
@ -643,7 +643,7 @@ export class FeedModel {
} else if (this.feedType === 'goodstuff') { } else if (this.feedType === 'goodstuff') {
const res = await this.rootStore.api.app.bsky.feed.getAuthorFeed({ const res = await this.rootStore.api.app.bsky.feed.getAuthorFeed({
...params, ...params,
author: 'jay.bsky.social', author: GOOD_STUFF(String(this.rootStore.agent.service)),
} as GetAuthorFeed.QueryParams) } as GetAuthorFeed.QueryParams)
res.data.feed = mergePosts([res], {repostsOnly: true}) res.data.feed = mergePosts([res], {repostsOnly: true})
res.data.feed.forEach(item => { res.data.feed.forEach(item => {