2.0.2 #106

Merged
defnotken merged 36 commits from 2.0.2 into master 2025-12-31 02:29:37 +00:00
Showing only changes of commit 474fd5ef11 - Show all commits

View File

@@ -1000,23 +1000,26 @@ public sealed class ZoneChatUi : WindowMediatorSubscriberBase
if (sanitized is not null)
{
TrackPendingDraftClear(channel.Key, sanitized);
draft = string.Empty;
_draftMessages[channel.Key] = draft;
_scrollToBottom = true;
if (TrySendDraft(channel, sanitized))
_ = Task.Run(async () =>
{
_scrollToBottom = true;
if (_draftMessages.TryGetValue(channel.Key, out var current) &&
string.Equals(current, draftAtSend, StringComparison.Ordinal))
try
{
draft = string.Empty;
_draftMessages[channel.Key] = draft;
var succeeded = await _zoneChatService.SendMessageAsync(channel.Descriptor, sanitized).ConfigureAwait(false);
if (!succeeded)
{
RemovePendingDraftClear(channel.Key, sanitized);
}
}
}
else
{
RemovePendingDraftClear(channel.Key, sanitized);
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Failed to send chat message");
RemovePendingDraftClear(channel.Key, sanitized);
}
});
}
}
}