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/following.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/following.ts')
-rw-r--r-- | src/lib/api/feed/following.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/api/feed/following.ts b/src/lib/api/feed/following.ts index 13f06c7ab..24389b5ed 100644 --- a/src/lib/api/feed/following.ts +++ b/src/lib/api/feed/following.ts @@ -1,11 +1,12 @@ -import {AppBskyFeedDefs, BskyAgent} from '@atproto/api' +import {AppBskyFeedDefs} from '@atproto/api' import {FeedAPI, FeedAPIResponse} from './types' +import {getAgent} from '#/state/session' export class FollowingFeedAPI implements FeedAPI { - constructor(public agent: BskyAgent) {} + constructor() {} async peekLatest(): Promise<AppBskyFeedDefs.FeedViewPost> { - const res = await this.agent.getTimeline({ + const res = await getAgent().getTimeline({ limit: 1, }) return res.data.feed[0] @@ -18,7 +19,7 @@ export class FollowingFeedAPI implements FeedAPI { cursor: string | undefined limit: number }): Promise<FeedAPIResponse> { - const res = await this.agent.getTimeline({ + const res = await getAgent().getTimeline({ cursor, limit, }) |