about summary refs log tree commit diff
path: root/src/lib/api/feed/following.ts
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2023-11-30 17:11:51 +0000
committerSamuel Newman <mozzius@protonmail.com>2023-11-30 17:11:51 +0000
commitb164f151cc352c62212a815e77dbdd23be530e7f (patch)
tree4df0df19dcd07afb1909171429ddc3ebcbfa42c5 /src/lib/api/feed/following.ts
parentee5d7a63ce08f2b395c71fb35dbdb0d9bb0f1dee (diff)
parentfcd22d4ccb0718db1c9b64fccd90a8bfe3e885d4 (diff)
downloadvoidsky-b164f151cc352c62212a815e77dbdd23be530e7f.tar.zst
Merge remote-tracking branch 'upstream/main' into invite-code-warning
Diffstat (limited to 'src/lib/api/feed/following.ts')
-rw-r--r--src/lib/api/feed/following.ts9
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,
     })