migrate server config from v0 to v1, add more transfer bar settings

This commit is contained in:
rootdarkarchon
2023-03-17 13:01:04 +01:00
parent 82991a1172
commit 549bef1afb
13 changed files with 144 additions and 50 deletions

View File

@@ -632,8 +632,10 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
string[] comboEntries = _serverConfigurationManager.GetServerNames();
if (_serverSelectionIndex == -1)
{
_serverSelectionIndex = Array.IndexOf(_serverConfigurationManager.GetServerApiUrls(), _serverConfigurationManager.CurrentApiUrl);
if (_serverSelectionIndex == -1)
}
if (_serverSelectionIndex == -1 || _serverSelectionIndex >= comboEntries.Length)
{
_serverSelectionIndex = 0;
}
@@ -669,7 +671,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
{
ImGui.SameLine();
var text = "Connect";
if (_serverSelectionIndex == _serverConfigurationManager.GetCurrentServerIndex()) text = "Reconnect";
if (_serverSelectionIndex == _serverConfigurationManager.CurrentServerIndex) text = "Reconnect";
if (IconTextButton(FontAwesomeIcon.Link, text))
{
_serverConfigurationManager.SelectServer(_serverSelectionIndex);