swap to fly.io

This commit is contained in:
2024-05-29 13:01:20 +02:00
parent a5a322cd38
commit f2f6547b22
13 changed files with 129 additions and 124 deletions
+4 -8
View File
@@ -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>