From e984304c1bc2c42c37c969116f2d7e20493642f8 Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Tue, 4 Oct 2022 01:03:05 +0200 Subject: [PATCH] fix showing alias when empty --- MareSynchronos/UI/GroupPanel.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MareSynchronos/UI/GroupPanel.cs b/MareSynchronos/UI/GroupPanel.cs index cceb985..0261b94 100644 --- a/MareSynchronos/UI/GroupPanel.cs +++ b/MareSynchronos/UI/GroupPanel.cs @@ -163,7 +163,7 @@ namespace MareSynchronos.UI ? 1 : (ImGui.GetWindowContentRegionMax().Y - ImGui.GetWindowContentRegionMin().Y) - _mainUi.TransferPartHeight - ImGui.GetCursorPosY(); ImGui.BeginChild("list", new Vector2(_mainUi._windowContentWidth, ySize), false); - foreach (var entry in _apiController.Groups.OrderBy(g => g.Alias ?? g.GID).ToList()) + foreach (var entry in _apiController.Groups.OrderBy(g => string.IsNullOrEmpty(g.Alias) ? g.GID : g.Alias).ToList()) { UiShared.DrawWithID(entry.GID, () => DrawSyncshell(entry)); } @@ -197,7 +197,7 @@ namespace MareSynchronos.UI UiShared.AttachToolTip(((group.IsPaused ?? false) ? "Resume" : "Pause") + " pairing with all users in this Syncshell"); ImGui.SameLine(); - var groupName = group.Alias ?? group.GID; + var groupName = string.IsNullOrEmpty(group.Alias) ? group.GID : group.Alias; var textIsGid = true; if (string.Equals(group.OwnedBy, _apiController.UID, StringComparison.Ordinal)) @@ -316,7 +316,7 @@ namespace MareSynchronos.UI if (UiShared.IconTextButton(FontAwesomeIcon.Copy, "Copy ID")) { - ImGui.SetClipboardText(entry.Alias ?? entry.GID); + ImGui.SetClipboardText(string.IsNullOrEmpty(entry.Alias) ? entry.GID : entry.Alias); } UiShared.AttachToolTip("Copy Syncshell ID to Clipboard");