fix open notes popup on user addition, fix saving on every secrey key access

This commit is contained in:
rootdarkarchon
2023-01-29 21:13:27 +01:00
parent 97b8e0e911
commit 6b4359c0c2
6 changed files with 11 additions and 12 deletions

View File

@@ -66,6 +66,8 @@ public class PairManager : IDisposable
public List<Pair> OnlineUserPairs => _allClientPairs.Where(p => !string.IsNullOrEmpty(p.Value.PlayerNameHash)).Select(p => p.Value).ToList();
public List<UserData> VisibleUsers => _allClientPairs.Where(p => p.Value.CachedPlayer != null && p.Value.CachedPlayer.IsVisible).Select(p => p.Key).ToList();
public Pair? LastAddedUser { get; internal set; }
public void AddGroup(GroupFullInfoDto dto)
{
_allGroups[dto.Group] = dto;
@@ -109,8 +111,8 @@ public class PairManager : IDisposable
public void AddUserPair(UserPairDto dto)
{
if (!_allClientPairs.ContainsKey(dto.User)) _allClientPairs[dto.User] = _pairFactory.Create();
_allClientPairs[dto.User].UserPair = dto;
LastAddedUser = _allClientPairs[dto.User];
_allClientPairs[dto.User].ApplyLastReceivedData();
RecreateLazy();
}

View File

@@ -74,7 +74,6 @@ public class ServerConfigurationManager
{
ServerStorage? currentServer;
currentServer = serverIdx == -1 ? CurrentServer : GetServerByIndex(serverIdx);
Save();
if (currentServer == null)
{
currentServer = new();