Fixed some stuff

This commit is contained in:
CakeAndBanana
2025-10-19 18:41:02 +02:00
parent edb7232b17
commit 477f5aa6e7
3 changed files with 11 additions and 18 deletions

View File

@@ -117,13 +117,14 @@ public partial class ApiController
}
public async Task<GroupProfileDto> GroupGetProfile(GroupDto dto)
{
CheckConnection();
if (!IsConnected) return new GroupProfileDto(Group: dto.Group, Description: null, Tags: null, PictureBase64: null, IsNsfw: false, IsDisabled: false);
return await _lightlessHub!.InvokeAsync<GroupProfileDto>(nameof(GroupGetProfile), dto).ConfigureAwait(false);
}
public async Task GroupSetProfile(GroupProfileDto dto)
{
if (!IsConnected) return;
CheckConnection();
await _lightlessHub!.InvokeAsync(nameof(GroupSetProfile), dto).ConfigureAwait(false);
}
@@ -150,7 +151,6 @@ public partial class ApiController
.ConfigureAwait(false);
}
private void CheckConnection()
{
if (ServerState is not (ServerState.Connected or ServerState.Connecting or ServerState.Reconnecting)) throw new InvalidDataException("Not connected");