diff options
author | Samuel Newman <mozzius@protonmail.com> | 2023-11-30 17:11:51 +0000 |
---|---|---|
committer | Samuel Newman <mozzius@protonmail.com> | 2023-11-30 17:11:51 +0000 |
commit | b164f151cc352c62212a815e77dbdd23be530e7f (patch) | |
tree | 4df0df19dcd07afb1909171429ddc3ebcbfa42c5 /src/lib/api/feed/custom.ts | |
parent | ee5d7a63ce08f2b395c71fb35dbdb0d9bb0f1dee (diff) | |
parent | fcd22d4ccb0718db1c9b64fccd90a8bfe3e885d4 (diff) | |
download | voidsky-b164f151cc352c62212a815e77dbdd23be530e7f.tar.zst |
Merge remote-tracking branch 'upstream/main' into invite-code-warning
Diffstat (limited to 'src/lib/api/feed/custom.ts')
-rw-r--r-- | src/lib/api/feed/custom.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/api/feed/custom.ts b/src/lib/api/feed/custom.ts index 0be98fb4a..47ffc65ed 100644 --- a/src/lib/api/feed/custom.ts +++ b/src/lib/api/feed/custom.ts @@ -1,18 +1,15 @@ import { AppBskyFeedDefs, AppBskyFeedGetFeed as GetCustomFeed, - BskyAgent, } from '@atproto/api' import {FeedAPI, FeedAPIResponse} from './types' +import {getAgent} from '#/state/session' export class CustomFeedAPI implements FeedAPI { - constructor( - public agent: BskyAgent, - public params: GetCustomFeed.QueryParams, - ) {} + constructor(public params: GetCustomFeed.QueryParams) {} async peekLatest(): Promise<AppBskyFeedDefs.FeedViewPost> { - const res = await this.agent.app.bsky.feed.getFeed({ + const res = await getAgent().app.bsky.feed.getFeed({ ...this.params, limit: 1, }) @@ -26,7 +23,7 @@ export class CustomFeedAPI implements FeedAPI { cursor: string | undefined limit: number }): Promise<FeedAPIResponse> { - const res = await this.agent.app.bsky.feed.getFeed({ + const res = await getAgent().app.bsky.feed.getFeed({ ...this.params, cursor, limit, |