Merge pull request 'Fixed chat input not clearing after sending.' (#116) from fix-chat-send into 2.0.2

Reviewed-on: #116
This commit was merged in pull request #116.
This commit is contained in:
2025-12-28 02:46:21 +00:00

View File

@@ -993,13 +993,25 @@ public sealed class ZoneChatUi : WindowMediatorSubscriberBase
{ {
_refocusChatInput = true; _refocusChatInput = true;
_refocusChatInputKey = channel.Key; _refocusChatInputKey = channel.Key;
var sanitized = SanitizeOutgoingDraft(draft);
var draftAtSend = draft;
var sanitized = SanitizeOutgoingDraft(draftAtSend);
if (sanitized is not null) if (sanitized is not null)
{ {
TrackPendingDraftClear(channel.Key, sanitized); TrackPendingDraftClear(channel.Key, sanitized);
if (TrySendDraft(channel, sanitized)) if (TrySendDraft(channel, sanitized))
{ {
_scrollToBottom = true; _scrollToBottom = true;
if (_draftMessages.TryGetValue(channel.Key, out var current) &&
string.Equals(current, draftAtSend, StringComparison.Ordinal))
{
draft = string.Empty;
_draftMessages[channel.Key] = draft;
}
} }
else else
{ {