await promises (#8519)
This commit is contained in:
@@ -95,17 +95,12 @@ async function unFollow(follower: User, followee: User) {
|
||||
return;
|
||||
}
|
||||
|
||||
Followings.delete(following.id);
|
||||
|
||||
//#region Decrement following count
|
||||
Users.decrement({ id: follower.id }, 'followingCount', 1);
|
||||
//#endregion
|
||||
|
||||
//#region Decrement followers count
|
||||
Users.decrement({ id: followee.id }, 'followersCount', 1);
|
||||
//#endregion
|
||||
|
||||
perUserFollowingChart.update(follower, followee, false);
|
||||
await Promises.all([
|
||||
Followings.delete(following.id),
|
||||
Users.decrement({ id: follower.id }, 'followingCount', 1),
|
||||
Users.decrement({ id: followee.id }, 'followersCount', 1),
|
||||
perUserFollowingChart.update(follower, followee, false),
|
||||
]);
|
||||
|
||||
// Publish unfollow event
|
||||
if (Users.isLocalUser(follower)) {
|
||||
|
Reference in New Issue
Block a user