From 9bd411c15159609803c4e8c3e352a9db32ea527c Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 28 May 2024 16:37:51 +0100 Subject: Replace getAgent() with reading agent (#4243) * Replace getAgent() with agent * Replace {agent} with agent --- src/lib/api/feed/custom.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/lib/api/feed/custom.ts') diff --git a/src/lib/api/feed/custom.ts b/src/lib/api/feed/custom.ts index 87e45ceba..eb54dd29c 100644 --- a/src/lib/api/feed/custom.ts +++ b/src/lib/api/feed/custom.ts @@ -10,27 +10,27 @@ import {FeedAPI, FeedAPIResponse} from './types' import {createBskyTopicsHeader, isBlueskyOwnedFeed} from './utils' export class CustomFeedAPI implements FeedAPI { - getAgent: () => BskyAgent + agent: BskyAgent params: GetCustomFeed.QueryParams userInterests?: string constructor({ - getAgent, + agent, feedParams, userInterests, }: { - getAgent: () => BskyAgent + agent: BskyAgent feedParams: GetCustomFeed.QueryParams userInterests?: string }) { - this.getAgent = getAgent + this.agent = agent this.params = feedParams this.userInterests = userInterests } async peekLatest(): Promise { const contentLangs = getContentLanguages().join(',') - const res = await this.getAgent().app.bsky.feed.getFeed( + const res = await this.agent.app.bsky.feed.getFeed( { ...this.params, limit: 1, @@ -48,11 +48,11 @@ export class CustomFeedAPI implements FeedAPI { limit: number }): Promise { const contentLangs = getContentLanguages().join(',') - const agent = this.getAgent() + const agent = this.agent const isBlueskyOwned = isBlueskyOwnedFeed(this.params.feed) const res = agent.session - ? await this.getAgent().app.bsky.feed.getFeed( + ? await this.agent.app.bsky.feed.getFeed( { ...this.params, cursor, -- cgit 1.4.1