swap to fly.io
This commit is contained in:
+4
-8
@@ -57,9 +57,7 @@
|
||||
textarea.addEventListener('keydown', handleTextareaKeydown);
|
||||
|
||||
function toggleSendButton() {
|
||||
const sendButton = document.getElementById('chat-input-send-btn');
|
||||
const selectedLLMIds = JSON.parse(getSelectedModelsIDs());
|
||||
sendButton.disabled = textarea.value.trim() === '' || selectedLLMIds.length === 0;
|
||||
document.getElementById('chat-input-send-btn').disabled = textarea.value.trim().length === 0 || document.getElementsByClassName('selected icon-llm').length === 0;
|
||||
}
|
||||
|
||||
function clearTextArea() {
|
||||
@@ -75,12 +73,10 @@
|
||||
}
|
||||
|
||||
function handleTextareaKeydown(event) {
|
||||
if (event.metaKey && event.key === 'Enter') {
|
||||
if (event.metaKey && event.key === 'Enter' && event.target === textarea && textarea.value.trim() !== '' && document.getElementsByClassName('selected icon-llm').length !== 0) {
|
||||
// Check if the cursor is in the textarea
|
||||
if (event.target === textarea) {
|
||||
// Trigger the same action as the send button
|
||||
document.getElementById('chat-input-send-btn').click();
|
||||
}
|
||||
// Trigger the same action as the send button
|
||||
document.getElementById('chat-input-send-btn').click();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user