about summary refs log tree commit diff
path: root/src/lib/api/feed/custom.ts
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-05-28 16:37:51 +0100
committerGitHub <noreply@github.com>2024-05-28 16:37:51 +0100
commit9bd411c15159609803c4e8c3e352a9db32ea527c (patch)
tree31305e290bd4597aa6ab441ecc556999b19ad693 /src/lib/api/feed/custom.ts
parent8a2f43c218c464e6165f331e482b6094b87eefc7 (diff)
downloadvoidsky-9bd411c15159609803c4e8c3e352a9db32ea527c.tar.zst
Replace getAgent() with reading agent (#4243)
* Replace getAgent() with agent

* Replace {agent} with agent
Diffstat (limited to 'src/lib/api/feed/custom.ts')
-rw-r--r--src/lib/api/feed/custom.ts14
1 files changed, 7 insertions, 7 deletions
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<AppBskyFeedDefs.FeedViewPost> {
     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<FeedAPIResponse> {
     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,