diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-29 10:10:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-29 10:10:04 -0800 |
commit | 6fe2b52f6860916a62bf9a4d680a0a3b91b50d91 (patch) | |
tree | 92da7f206d6945752e149a2f1af8bbb31773efec /src/lib/api/feed/author.ts | |
parent | 9fb2c29c672f6be07410ae1ca4d7e47b6c98f914 (diff) | |
download | voidsky-6fe2b52f6860916a62bf9a4d680a0a3b91b50d91.tar.zst |
Get more rigorous about getAgent() consistency (#2026)
* Get more rigorous about getAgent() consistency * Update the feed wrapper API to use getAgent() directly
Diffstat (limited to 'src/lib/api/feed/author.ts')
-rw-r--r-- | src/lib/api/feed/author.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/api/feed/author.ts b/src/lib/api/feed/author.ts index 77c167869..92df84f8b 100644 --- a/src/lib/api/feed/author.ts +++ b/src/lib/api/feed/author.ts @@ -1,18 +1,15 @@ import { AppBskyFeedDefs, AppBskyFeedGetAuthorFeed as GetAuthorFeed, - BskyAgent, } from '@atproto/api' import {FeedAPI, FeedAPIResponse} from './types' +import {getAgent} from '#/state/session' export class AuthorFeedAPI implements FeedAPI { - constructor( - public agent: BskyAgent, - public params: GetAuthorFeed.QueryParams, - ) {} + constructor(public params: GetAuthorFeed.QueryParams) {} async peekLatest(): Promise<AppBskyFeedDefs.FeedViewPost> { - const res = await this.agent.getAuthorFeed({ + const res = await getAgent().getAuthorFeed({ ...this.params, limit: 1, }) @@ -26,7 +23,7 @@ export class AuthorFeedAPI implements FeedAPI { cursor: string | undefined limit: number }): Promise<FeedAPIResponse> { - const res = await this.agent.getAuthorFeed({ + const res = await getAgent().getAuthorFeed({ ...this.params, cursor, limit, |