diff --git a/packages/bsky/src/hydration/feed.ts b/packages/bsky/src/hydration/feed.ts index 5462b72f3e1..a7999483887 100644 --- a/packages/bsky/src/hydration/feed.ts +++ b/packages/bsky/src/hydration/feed.ts @@ -82,21 +82,21 @@ export class FeedHydrator { } async getPostViewerStates( - uris: string[], + refs: ItemRef[], viewer: string, ): Promise { - if (!uris.length) return new HydrationMap() + if (!refs.length) return new HydrationMap() const [likes, reposts] = await Promise.all([ this.dataplane.getLikesByActorAndSubjects({ actorDid: viewer, - refs: uris.map((uri) => ({ uri })), + refs, }), this.dataplane.getRepostsByActorAndSubjects({ actorDid: viewer, - refs: uris.map((uri) => ({ uri })), + refs, }), ]) - return uris.reduce((acc, uri, i) => { + return refs.reduce((acc, { uri }, i) => { return acc.set(uri, { like: parseString(likes.uris[i]), repost: parseString(reposts.uris[i]), diff --git a/packages/bsky/src/hydration/hydrator.ts b/packages/bsky/src/hydration/hydrator.ts index b0d8f977a5c..893234e6f6a 100644 --- a/packages/bsky/src/hydration/hydrator.ts +++ b/packages/bsky/src/hydration/hydrator.ts @@ -254,7 +254,7 @@ export class Hydrator { feedGenState, ] = await Promise.all([ this.feed.getPostAggregates(refs), - viewer ? this.feed.getPostViewerStates(uris, viewer) : undefined, + viewer ? this.feed.getPostViewerStates(refs, viewer) : undefined, this.label.getLabelsForSubjects(allPostUris), this.hydratePostBlocks(posts), this.hydrateProfiles(