diff options
Diffstat (limited to 'src/lib/api/feed/list.ts')
-rw-r--r-- | src/lib/api/feed/list.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/api/feed/list.ts b/src/lib/api/feed/list.ts index 6cb0730e7..19f2ff177 100644 --- a/src/lib/api/feed/list.ts +++ b/src/lib/api/feed/list.ts @@ -1,18 +1,15 @@ import { AppBskyFeedDefs, AppBskyFeedGetListFeed as GetListFeed, - BskyAgent, } from '@atproto/api' import {FeedAPI, FeedAPIResponse} from './types' +import {getAgent} from '#/state/session' export class ListFeedAPI implements FeedAPI { - constructor( - public agent: BskyAgent, - public params: GetListFeed.QueryParams, - ) {} + constructor(public params: GetListFeed.QueryParams) {} async peekLatest(): Promise<AppBskyFeedDefs.FeedViewPost> { - const res = await this.agent.app.bsky.feed.getListFeed({ + const res = await getAgent().app.bsky.feed.getListFeed({ ...this.params, limit: 1, }) @@ -26,7 +23,7 @@ export class ListFeedAPI implements FeedAPI { cursor: string | undefined limit: number }): Promise<FeedAPIResponse> { - const res = await this.agent.app.bsky.feed.getListFeed({ + const res = await getAgent().app.bsky.feed.getListFeed({ ...this.params, cursor, limit, |