1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-29 23:22:55 +08:00

Update TestMetadataClient to correctly set local user state in line with changes

This commit is contained in:
Dean Herbert 2025-01-17 16:29:02 +09:00
parent 3bb4b0c2b8
commit 311f08b962
No known key found for this signature in database

View File

@ -48,11 +48,12 @@ namespace osu.Game.Tests.Visual.Metadata
public override Task UpdateActivity(UserActivity? activity)
{
localUserPresence = localUserPresence with { Activity = activity };
if (isWatchingUserPresence.Value)
{
userPresences.TryGetValue(api.LocalUser.Value.Id, out var localUserPresence);
localUserPresence = localUserPresence with { Activity = activity };
userPresences[api.LocalUser.Value.Id] = localUserPresence;
if (userPresences.ContainsKey(api.LocalUser.Value.Id))
userPresences[api.LocalUser.Value.Id] = localUserPresence;
}
return Task.CompletedTask;
@ -60,11 +61,12 @@ namespace osu.Game.Tests.Visual.Metadata
public override Task UpdateStatus(UserStatus? status)
{
localUserPresence = localUserPresence with { Status = status };
if (isWatchingUserPresence.Value)
{
userPresences.TryGetValue(api.LocalUser.Value.Id, out var localUserPresence);
localUserPresence = localUserPresence with { Status = status };
userPresences[api.LocalUser.Value.Id] = localUserPresence;
if (userPresences.ContainsKey(api.LocalUser.Value.Id))
userPresences[api.LocalUser.Value.Id] = localUserPresence;
}
return Task.CompletedTask;