about summary refs log tree commit diff
path: root/src/screens/Onboarding/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens/Onboarding/util.ts')
-rw-r--r--src/screens/Onboarding/util.ts17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/screens/Onboarding/util.ts b/src/screens/Onboarding/util.ts
index 14750f34c..d14c9562e 100644
--- a/src/screens/Onboarding/util.ts
+++ b/src/screens/Onboarding/util.ts
@@ -1,7 +1,9 @@
 import {
+  $Typed,
   AppBskyGraphFollow,
   AppBskyGraphGetFollows,
   BskyAgent,
+  ComAtprotoRepoApplyWrites,
 } from '@atproto/api'
 import {TID} from '@atproto/common-web'
 import chunk from 'lodash.chunk'
@@ -15,7 +17,7 @@ export async function bulkWriteFollows(agent: BskyAgent, dids: string[]) {
     throw new Error(`bulkWriteFollows failed: no session`)
   }
 
-  const followRecords: AppBskyGraphFollow.Record[] = dids.map(did => {
+  const followRecords: $Typed<AppBskyGraphFollow.Record>[] = dids.map(did => {
     return {
       $type: 'app.bsky.graph.follow',
       subject: did,
@@ -23,12 +25,13 @@ export async function bulkWriteFollows(agent: BskyAgent, dids: string[]) {
     }
   })
 
-  const followWrites = followRecords.map(r => ({
-    $type: 'com.atproto.repo.applyWrites#create',
-    collection: 'app.bsky.graph.follow',
-    rkey: TID.nextStr(),
-    value: r,
-  }))
+  const followWrites: $Typed<ComAtprotoRepoApplyWrites.Create>[] =
+    followRecords.map(r => ({
+      $type: 'com.atproto.repo.applyWrites#create',
+      collection: 'app.bsky.graph.follow',
+      rkey: TID.nextStr(),
+      value: r,
+    }))
 
   const chunks = chunk(followWrites, 50)
   for (const chunk of chunks) {