fix race when adding pinned feed

This commit is contained in:
Hailey
2024-06-10 12:25:57 -07:00
parent 60c3bc7677
commit 402d65ab42
4 changed files with 177 additions and 139 deletions
+3 -5
View File
@@ -1,6 +1,6 @@
import React from 'react'
import {View} from 'react-native'
import {AppBskyGraphDefs, AppBskyGraphStarterpack, AtUri} from '@atproto/api'
import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useQueryClient} from '@tanstack/react-query'
@@ -78,20 +78,18 @@ export function StepFinished() {
...(listItems?.map(i => i.subject.did) ?? []),
]),
(async () => {
await agent.setInterestsPref({tags: selectedInterests})
if (starterPack?.feeds?.length) {
await agent.addSavedFeeds(
starterPack.feeds.map(f => ({
type: 'feed',
value: f.uri,
pinned: true,
id: new AtUri(f.uri).rkey,
})),
)
}
})(),
(async () => {
await agent.setInterestsPref({tags: selectedInterests})
})(),
(async () => {
const {imageUri, imageMime} = profileStepResults
if (imageUri && imageMime) {