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 += () =>
|
||||
{
|
||||
bool becameFriend = status.Value == FriendStatus.None;
|
||||
|
||||
SetValue(followerCount += becameFriend ? 1 : -1);
|
||||
status.Value = becameFriend ? FriendStatus.NotMutual : FriendStatus.None;
|
||||
if (req is AddFriendRequest addedRequest)
|
||||
{
|
||||
SetValue(++followerCount);
|
||||
status.Value = addedRequest.Response?.Mutual == true ? FriendStatus.Mutual : FriendStatus.NotMutual;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetValue(--followerCount);
|
||||
status.Value = FriendStatus.None;
|
||||
}
|
||||
|
||||
api.UpdateLocalFriends();
|
||||
HideLoadingLayer();
|
||||
|
|
Loading…
Reference in New Issue