mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 21:22:56 +08:00
Handle response to get accurate mutual state immediately
This commit is contained in:
parent
0087270b7e
commit
1fcdf67806
@ -95,10 +95,16 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
||||
|
||||
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
Block a user