Fix to auth of mutation ops

This commit is contained in:
Paul Frazee 2022-10-03 11:17:12 -05:00
parent c7d7e152a0
commit 2058505bf1
6 changed files with 32 additions and 59 deletions

View file

@ -74,17 +74,13 @@ export class ProfileViewModel {
throw new Error('Not logged in')
}
if (this.myState.follow) {
await apilib.unfollow(this.rootStore.api, this.myState.follow)
await apilib.unfollow(this.rootStore, this.myState.follow)
runInAction(() => {
this.followersCount--
this.myState.follow = undefined
})
} else {
const res = await apilib.follow(
this.rootStore.api,
this.rootStore.me.did,
this.did,
)
const res = await apilib.follow(this.rootStore, this.did)
runInAction(() => {
this.followersCount++
this.myState.follow = res.uri