Fixed callbacks for cleaning up profiles.
This commit is contained in:
@@ -44,7 +44,21 @@ public class LightlessProfileManager : MediatorSubscriberBase
|
|||||||
else
|
else
|
||||||
_lightlessUserProfiles.Clear();
|
_lightlessUserProfiles.Clear();
|
||||||
});
|
});
|
||||||
Mediator.Subscribe<DisconnectedMessage>(this, (_) => _lightlessUserProfiles.Clear());
|
|
||||||
|
Mediator.Subscribe<ClearProfileGroupDataMessage>(this, (msg) =>
|
||||||
|
{
|
||||||
|
if (msg.GroupData != null)
|
||||||
|
_lightlessGroupProfiles.Remove(msg.GroupData, out _);
|
||||||
|
else
|
||||||
|
_lightlessGroupProfiles.Clear();
|
||||||
|
});
|
||||||
|
|
||||||
|
Mediator.Subscribe<DisconnectedMessage>(this, (_) =>
|
||||||
|
{
|
||||||
|
_lightlessUserProfiles.Clear();
|
||||||
|
_lightlessGroupProfiles.Clear();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LightlessUserProfileData GetLightlessUserProfile(UserData data)
|
public LightlessUserProfileData GetLightlessUserProfile(UserData data)
|
||||||
|
|||||||
@@ -65,6 +65,14 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
|||||||
_multiInvites = 30;
|
_multiInvites = 30;
|
||||||
_pwChangeSuccess = true;
|
_pwChangeSuccess = true;
|
||||||
IsOpen = true;
|
IsOpen = true;
|
||||||
|
Mediator.Subscribe<ClearProfileGroupDataMessage>(this, (msg) =>
|
||||||
|
{
|
||||||
|
if (msg.GroupData == null || string.Equals(msg.GroupData.GID, GroupFullInfo.Group.GID, StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
_pfpTextureWrap?.Dispose();
|
||||||
|
_pfpTextureWrap = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
SizeConstraints = new WindowSizeConstraints()
|
SizeConstraints = new WindowSizeConstraints()
|
||||||
{
|
{
|
||||||
MinimumSize = new(700, 500),
|
MinimumSize = new(700, 500),
|
||||||
|
|||||||
@@ -199,6 +199,13 @@ public partial class ApiController
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task Client_GroupSendProfile(GroupProfileDto groupInfo)
|
||||||
|
{
|
||||||
|
Logger.LogDebug("Client_GroupSendProfile: {dto}", groupInfo);
|
||||||
|
ExecuteSafely(() => Mediator.Publish(new ClearProfileGroupDataMessage(groupInfo.Group)));
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
public Task Client_UserUpdateSelfPairPermissions(UserPermissionsDto dto)
|
public Task Client_UserUpdateSelfPairPermissions(UserPermissionsDto dto)
|
||||||
{
|
{
|
||||||
Logger.LogDebug("Client_UserUpdateSelfPairPermissions: {dto}", dto);
|
Logger.LogDebug("Client_UserUpdateSelfPairPermissions: {dto}", dto);
|
||||||
|
|||||||
@@ -607,10 +607,5 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IL
|
|||||||
|
|
||||||
ServerState = state;
|
ServerState = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task Client_GroupSendProfile(GroupProfileDto groupInfo)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#pragma warning restore MA0040
|
#pragma warning restore MA0040
|
||||||
Reference in New Issue
Block a user