Fix follows

This commit is contained in:
Paul Frazee
2022-11-10 16:35:13 -06:00
parent 7d90638188
commit 6b3780f6d1
3 changed files with 25 additions and 15 deletions
+9 -3
View File
@@ -111,12 +111,18 @@ export async function unrepost(store: RootStoreModel, repostUri: string) {
})
}
export async function follow(store: RootStoreModel, subject: string) {
// TODO NOW needs update
export async function follow(
store: RootStoreModel,
subjectDid: string,
subjectDeclarationCid: string,
) {
return await store.api.app.bsky.graph.follow.create(
{did: store.me.did || ''},
{
subject,
subject: {
did: subjectDid,
declarationCid: subjectDeclarationCid,
},
createdAt: new Date().toISOString(),
},
)
+5 -1
View File
@@ -98,7 +98,11 @@ export class ProfileViewModel {
this.myState.follow = undefined
})
} else {
const res = await apilib.follow(this.rootStore, this.did)
const res = await apilib.follow(
this.rootStore,
this.did,
this.declaration.cid,
)
runInAction(() => {
this.followersCount++
this.myState.follow = res.uri