mirror of https://github.com/ppy/osu
Handle response to get accurate mutual state immediately
This commit is contained in:
parent
0087270b7e
commit
1fcdf67806
|
@ -95,10 +95,16 @@ private void load(IAPIProvider api, INotificationOverlay? notifications)
|
||||||
|
|
||||||
req.Success += () =>
|
req.Success += () =>
|
||||||
{
|
{
|
||||||
bool becameFriend = status.Value == FriendStatus.None;
|
if (req is AddFriendRequest addedRequest)
|
||||||
|
{
|
||||||
SetValue(followerCount += becameFriend ? 1 : -1);
|
SetValue(++followerCount);
|
||||||
status.Value = becameFriend ? FriendStatus.NotMutual : FriendStatus.None;
|
status.Value = addedRequest.Response?.Mutual == true ? FriendStatus.Mutual : FriendStatus.NotMutual;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetValue(--followerCount);
|
||||||
|
status.Value = FriendStatus.None;
|
||||||
|
}
|
||||||
|
|
||||||
api.UpdateLocalFriends();
|
api.UpdateLocalFriends();
|
||||||
HideLoadingLayer();
|
HideLoadingLayer();
|
||||||
|
|
Loading…
Reference in New Issue