guard againsts >25 items
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
type AppBskyFeedGetPosts,
|
||||
} from '@atproto/api'
|
||||
|
||||
import {logger} from '#/logger'
|
||||
import {type FeedAPI, type FeedAPIResponse} from './types'
|
||||
|
||||
export class PostListFeedAPI implements FeedAPI {
|
||||
@@ -19,7 +20,14 @@ export class PostListFeedAPI implements FeedAPI {
|
||||
feedParams: AppBskyFeedGetPosts.QueryParams
|
||||
}) {
|
||||
this.agent = agent
|
||||
this.params = feedParams
|
||||
if (feedParams.uris.length > 25) {
|
||||
logger.warn(
|
||||
`Too many URIs provided - expected 25, got ${feedParams.uris.length}`,
|
||||
)
|
||||
}
|
||||
this.params = {
|
||||
uris: feedParams.uris.slice(0, 25),
|
||||
}
|
||||
}
|
||||
|
||||
async peekLatest(): Promise<AppBskyFeedDefs.FeedViewPost> {
|
||||
|
||||
@@ -33,10 +33,10 @@ export function NotificationsActivityListScreen({
|
||||
</Layout.Header.Outer>
|
||||
<PostFeed
|
||||
feed={`posts|${uris}`}
|
||||
disablePoll
|
||||
renderEmptyState={() => (
|
||||
<EmptyState icon="growth" message={_(msg`No posts here`)} />
|
||||
)}
|
||||
disablePoll
|
||||
renderEndOfFeed={() => <ListFooter />}
|
||||
/>
|
||||
</Layout.Screen>
|
||||
|
||||
@@ -134,7 +134,7 @@ let NotificationFeedItem = ({
|
||||
for (const post of [item.notification, ...(item.additional ?? [])]) {
|
||||
posts.push(post.uri)
|
||||
}
|
||||
return `/notifications/activity?posts=${encodeURIComponent(posts.join(','))}`
|
||||
return `/notifications/activity?posts=${encodeURIComponent(posts.slice(0, 25).join(','))}`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user