From ef8448caaa2efec765951e9e74da3d037d9044d3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 16 Mar 2025 12:09:10 +0900 Subject: [PATCH] Use switch statement class type matching --- .../Overlays/Dashboard/CurrentlyOnlineDisplay.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs b/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs index fce73f0198..39df3ba22c 100644 --- a/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs +++ b/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs @@ -187,7 +187,19 @@ namespace osu.Game.Overlays.Dashboard // TODO: we probably don't want to do this every frame. var activity = metadataClient?.GetPresence(User.Id)?.Activity; - spectateButton.Enabled.Value = activity is UserActivity.InSoloGame or UserActivity.InMultiplayerGame or UserActivity.InPlaylistGame; + + switch (activity) + { + default: + spectateButton.Enabled.Value = false; + break; + + case UserActivity.InSoloGame: + case UserActivity.InMultiplayerGame: + case UserActivity.InPlaylistGame: + spectateButton.Enabled.Value = true; + break; + } } [BackgroundDependencyLoader]