refac: allow image only message via enter

This commit is contained in:
Timothy Jaeryang Baek 2025-02-25 01:40:17 -08:00
parent 7e2b2ec761
commit 5d3249848d

View File

@ -828,7 +828,11 @@
} }
// Submit the prompt when Enter key is pressed // Submit the prompt when Enter key is pressed
if (prompt !== '' && e.keyCode === 13 && !e.shiftKey) { if (
(prompt !== '' || files.length > 0) &&
e.keyCode === 13 &&
!e.shiftKey
) {
dispatch('submit', prompt); dispatch('submit', prompt);
} }
} }
@ -907,7 +911,11 @@
} }
// Submit the prompt when Enter key is pressed // Submit the prompt when Enter key is pressed
if (prompt !== '' && e.key === 'Enter' && !e.shiftKey) { if (
(prompt !== '' || files.length > 0) &&
e.key === 'Enter' &&
!e.shiftKey
) {
dispatch('submit', prompt); dispatch('submit', prompt);
} }
} }