From 67f7ac8bb52902ee47349cf2e31da7fbe625358b Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 18 Nov 2024 22:27:42 -0800 Subject: [PATCH] refac --- src/lib/components/chat/MessageInput.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 4254b61a0..8f82d8922 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -776,10 +776,10 @@ reader.readAsDataURL(blob); } else if (item.type === 'text/plain') { if ($settings?.largeTextAsFile ?? false) { - e.preventDefault(); const text = await clipboardData.getData('text/plain'); if (text.length > PASTED_TEXT_CHARACTER_LIMIT) { + e.preventDefault(); const blob = new Blob([text], { type: 'text/plain' }); const file = new File([blob], `Pasted_Text_${Date.now()}.txt`, { type: 'text/plain' @@ -966,10 +966,10 @@ reader.readAsDataURL(blob); } else if (item.type === 'text/plain') { if ($settings?.largeTextAsFile ?? false) { - e.preventDefault(); const text = await clipboardData.getData('text/plain'); if (text.length > PASTED_TEXT_CHARACTER_LIMIT) { + e.preventDefault(); const blob = new Blob([text], { type: 'text/plain' }); const file = new File([blob], `Pasted_Text_${Date.now()}.txt`, { type: 'text/plain'