forked from AkkomaGang/akkoma-fe
correctly update relationship on follow/unfollow
This commit is contained in:
parent
82f077feb9
commit
d766059dee
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ const fetchUser = (attempt, user, store) => new Promise((resolve, reject) => {
|
||||||
export const requestFollow = (user, store) => new Promise((resolve, reject) => {
|
export const requestFollow = (user, store) => new Promise((resolve, reject) => {
|
||||||
store.state.api.backendInteractor.followUser(user.id)
|
store.state.api.backendInteractor.followUser(user.id)
|
||||||
.then((updated) => {
|
.then((updated) => {
|
||||||
store.commit('addNewUsers', [updated])
|
store.commit('updateUserRelationship', [updated])
|
||||||
|
|
||||||
// For locked users we just mark it that we sent the follow request
|
// For locked users we just mark it that we sent the follow request
|
||||||
if (updated.locked) {
|
if (updated.locked) {
|
||||||
|
@ -66,7 +66,7 @@ export const requestFollow = (user, store) => new Promise((resolve, reject) => {
|
||||||
export const requestUnfollow = (user, store) => new Promise((resolve, reject) => {
|
export const requestUnfollow = (user, store) => new Promise((resolve, reject) => {
|
||||||
store.state.api.backendInteractor.unfollowUser(user.id)
|
store.state.api.backendInteractor.unfollowUser(user.id)
|
||||||
.then((updated) => {
|
.then((updated) => {
|
||||||
store.commit('addNewUsers', [updated])
|
store.commit('updateUserRelationship', [updated])
|
||||||
resolve({
|
resolve({
|
||||||
updated
|
updated
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue