From 9c51b78fde129c5c9ceab6dbf7848413b5fa306f Mon Sep 17 00:00:00 2001 From: rootdarkarchon Date: Sun, 29 Jan 2023 15:51:50 +0100 Subject: [PATCH] fixes UID display, adding new secret key when none are available, showing intro ui --- MareSynchronos/Managers/ServerConfigurationManager.cs | 2 +- MareSynchronos/UI/CompactUI.cs | 2 +- MareSynchronos/UI/SettingsUi.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MareSynchronos/Managers/ServerConfigurationManager.cs b/MareSynchronos/Managers/ServerConfigurationManager.cs index 729e47e..0648071 100644 --- a/MareSynchronos/Managers/ServerConfigurationManager.cs +++ b/MareSynchronos/Managers/ServerConfigurationManager.cs @@ -22,7 +22,7 @@ public class ServerConfigurationManager public bool HasValidConfig() { - return CurrentServer != null && (CurrentServer?.Authentications.Any() ?? false); + return CurrentServer != null; } public string[] GetServerApiUrls() diff --git a/MareSynchronos/UI/CompactUI.cs b/MareSynchronos/UI/CompactUI.cs index ddcc049..530247c 100644 --- a/MareSynchronos/UI/CompactUI.cs +++ b/MareSynchronos/UI/CompactUI.cs @@ -802,7 +802,7 @@ public class CompactUi : Window, IDisposable ServerState.Offline => "Unavailable", ServerState.RateLimited => "Rate Limited", ServerState.NoSecretKey => "No Secret Key", - ServerState.Connected => _apiController.UID, + ServerState.Connected => _apiController.DisplayName, _ => string.Empty }; } diff --git a/MareSynchronos/UI/SettingsUi.cs b/MareSynchronos/UI/SettingsUi.cs index 6be163c..d20e72e 100644 --- a/MareSynchronos/UI/SettingsUi.cs +++ b/MareSynchronos/UI/SettingsUi.cs @@ -368,7 +368,7 @@ public class SettingsUi : Window, IDisposable ImGui.Separator(); if (UiShared.IconTextButton(FontAwesomeIcon.Plus, "Add new Secret Key")) { - selectedServer.SecretKeys.Add(selectedServer.SecretKeys.Last().Key + 1, new SecretKey() + selectedServer.SecretKeys.Add(selectedServer.SecretKeys.LastOrDefault().Key + 1, new SecretKey() { FriendlyName = "New Secret Key", });