diff options
author | Eric Bailey <git@esb.lol> | 2023-08-22 14:30:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-22 12:30:51 -0700 |
commit | 2b13dc0f3abfdb0eca03150bd77d773bbb26ebd4 (patch) | |
tree | b17e377c3c733092927f82f309d881194c4aa1de /src/state/models/feeds/posts.ts | |
parent | 548ec6c82d114f96c431a4e0f162e8360bfd22f4 (diff) | |
download | voidsky-2b13dc0f3abfdb0eca03150bd77d773bbb26ebd4.tar.zst |
Add likes tab (#1227)
* add likes tab (cherry picked from commit 6c5ffd964ca0b185ddfc37088d82712a006a1163) * only show Likes tab to authenticated user (cherry picked from commit ecc1254411d760158b6d7a4c5f05d940db872dfc) * Bump @atproto/api@0.6.5 * fix types --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
Diffstat (limited to 'src/state/models/feeds/posts.ts')
-rw-r--r-- | src/state/models/feeds/posts.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/state/models/feeds/posts.ts b/src/state/models/feeds/posts.ts index 93add8102..8bc75daa4 100644 --- a/src/state/models/feeds/posts.ts +++ b/src/state/models/feeds/posts.ts @@ -3,6 +3,7 @@ import { AppBskyFeedGetTimeline as GetTimeline, AppBskyFeedGetAuthorFeed as GetAuthorFeed, AppBskyFeedGetFeed as GetCustomFeed, + AppBskyFeedGetActorLikes as GetActorLikes, } from '@atproto/api' import AwaitLock from 'await-lock' import {bundleAsync} from 'lib/async/bundle' @@ -57,7 +58,7 @@ export class PostsFeedModel { constructor( public rootStore: RootStoreModel, - public feedType: 'home' | 'author' | 'custom', + public feedType: 'home' | 'author' | 'custom' | 'likes', params: QueryParams, options?: Options, ) { @@ -429,10 +430,14 @@ export class PostsFeedModel { res.data.feed = res.data.feed.slice(0, params.limit) } return res - } else { + } else if (this.feedType === 'author') { return this.rootStore.agent.getAuthorFeed( params as GetAuthorFeed.QueryParams, ) + } else { + return this.rootStore.agent.getActorLikes( + params as GetActorLikes.QueryParams, + ) } } } |