Fixed chat input not clearing after sending.

This commit is contained in:
cake
2025-12-28 03:45:02 +01:00
parent 8f32b375dd
commit dba04d740b

View File

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