adapt CurrentServerIndex fix into getter

This commit is contained in:
rootdarkarchon
2023-03-17 14:37:20 +01:00
parent 549bef1afb
commit 22aaf5d39e

View File

@@ -27,7 +27,25 @@ public class ServerConfigurationManager
public string CurrentApiUrl => CurrentServer.ServerUri;
public ServerStorage CurrentServer => _configService.Current.ServerStorage[CurrentServerIndex];
public int CurrentServerIndex => _configService.Current.CurrentServer;
public int CurrentServerIndex
{
set
{
_configService.Current.CurrentServer = value;
_configService.Save();
}
get
{
if (_configService.Current.CurrentServer < 0)
{
_configService.Current.CurrentServer = 0;
_configService.Save();
}
return _configService.Current.CurrentServer;
}
}
public string? GetSecretKey(int serverIdx = -1)
{