mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 18:25:26 -04:00
Fix pinned skill prompt submission race (#3841)
This commit is contained in:
@@ -339,10 +339,13 @@ function _submitComposedMessage(text) {
|
|||||||
const msgInput = document.getElementById('message');
|
const msgInput = document.getElementById('message');
|
||||||
const form = document.getElementById('chat-form');
|
const form = document.getElementById('chat-form');
|
||||||
if (!msgInput || !form) return false;
|
if (!msgInput || !form) return false;
|
||||||
|
// The slash handler and app-level form debounce must both release before
|
||||||
|
// sending the pinned prompt, otherwise the follow-up submit is dropped.
|
||||||
|
setTimeout(() => {
|
||||||
msgInput.value = text;
|
msgInput.value = text;
|
||||||
msgInput.dispatchEvent(new Event('input', { bubbles: true }));
|
msgInput.dispatchEvent(new Event('input', { bubbles: true }));
|
||||||
if (typeof form.requestSubmit === 'function') form.requestSubmit();
|
form.dispatchEvent(new Event('submit', { cancelable: true, bubbles: true }));
|
||||||
else form.dispatchEvent(new Event('submit', { cancelable: true, bubbles: true }));
|
}, 350);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user