1
0
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:
Dean Herbert 2024-11-05 16:20:55 +09:00
parent 0087270b7e
commit 1fcdf67806
No known key found for this signature in database

View File

@ -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();