fix(messages): 10ms delay for Quill keystroke processing + remove 500ms debounce
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

This commit is contained in:
Maciej Pienczyn 2026-03-28 17:20:43 +01:00
parent 1105099177
commit bd591a2aed

View File

@ -1225,12 +1225,12 @@
},
});
// Enter = send (capture phase fires BEFORE Quill processes the key)
// Enter = send (tiny delay lets Quill commit pending keystrokes)
state.quill.root.addEventListener('keydown', function (e) {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
e.stopImmediatePropagation();
Composer.send();
setTimeout(function() { Composer.send(); }, 10);
}
}, true);
@ -1273,13 +1273,8 @@
send: async function () {
if (!state.currentConversationId || !state.quill) return;
// Double-send guard: flag + timestamp debounce (500ms)
var now = Date.now();
if (state._isSending || (state._lastSendTime && now - state._lastSendTime < 500)) {
return;
}
if (state._isSending) return;
state._isSending = true;
state._lastSendTime = now;
var html = state.quill.root.innerHTML;
var text = state.quill.getText().trim();