mirror of
https://github.com/ppy/osu.git
synced 2026-05-17 12:45:32 +08:00
Update TestMetadataClient to correctly set local user state in line with changes
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user