Fix chat window

Fix chat window not closing when submitting empty string introduced in
47f5c27eec
Always call submitted hanlders.

Differential revision: D4621
Fixes: #6511
Patch by: @Langbart
Comments by: @elexis
This was SVN commit r26842.
This commit is contained in:
Angen 2022-04-29 17:48:01 +00:00
parent 9c0817849e
commit 59fdc5e591

View file

@ -33,7 +33,7 @@ class ChatInput
getInputHotkeyTooltip()
{
return translateWithContext("chat input", "Type the message to send.") + "\n" +
return translateWithContext("chat input", "Type the message to send.") + "\n" +
colorizeAutocompleteHotkey();
}
@ -84,10 +84,8 @@ class ChatInput
submitChatInput()
{
let text = this.chatInput.caption;
if (!text.length)
return;
this.chatSubmitHandlers.some(handler => handler(text, this.selectedCommand));
if (text)
this.chatSubmitHandlers.some(handler => handler(text, this.selectedCommand));
for (let handler of this.chatSubmittedHandlers)
handler();