mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 00:26:07 +02:00
fix: ghost channel when trying to join a channel that doesn't exist
This commit is contained in:
@@ -136,8 +136,10 @@ public sealed class EchoHubConnection : IAsyncDisposable
|
||||
|
||||
public async Task<List<MessageDto>> JoinChannelAsync(string channelName)
|
||||
{
|
||||
var messages = await _connection.InvokeAsync<List<MessageDto>>("JoinChannel", channelName);
|
||||
return DecryptMessages(messages);
|
||||
var result = await _connection.InvokeAsync<JoinChannelResult>("JoinChannel", channelName);
|
||||
if (!result.Success)
|
||||
throw new InvalidOperationException(result.Error ?? "Failed to join channel.");
|
||||
return DecryptMessages(result.History);
|
||||
}
|
||||
|
||||
public async Task LeaveChannelAsync(string channelName)
|
||||
|
||||
Reference in New Issue
Block a user