Merge pull request #1135 from JeLuF/ctrlv

Don't paste empty prompts
This commit is contained in:
cmdr2 2023-04-08 09:01:07 +05:30 committed by GitHub
commit 4c7b4c7592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -608,7 +608,7 @@ document.addEventListener('paste', async (event) => {
}
const paste = (event.clipboardData || window.clipboardData).getData('text')
const selection = window.getSelection()
if (selection.toString().trim().length <= 0 && await parseContent(paste)) {
if (paste != "" && selection.toString().trim().length <= 0 && await parseContent(paste)) {
event.preventDefault()
return
}