mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-13 23:44:15 +01:00
adapt CurrentServerIndex fix into getter
This commit is contained in:
parent
549bef1afb
commit
22aaf5d39e
1 changed files with 19 additions and 1 deletions
|
|
@ -27,7 +27,25 @@ public class ServerConfigurationManager
|
||||||
|
|
||||||
public string CurrentApiUrl => CurrentServer.ServerUri;
|
public string CurrentApiUrl => CurrentServer.ServerUri;
|
||||||
public ServerStorage CurrentServer => _configService.Current.ServerStorage[CurrentServerIndex];
|
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)
|
public string? GetSecretKey(int serverIdx = -1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue