From 96ec66a89c76d02c912902264ebcb1b8609a9798 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 21 Dec 2025 20:49:17 +0400 Subject: [PATCH] refac --- src/lib/components/channel/MessageInput.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/components/channel/MessageInput.svelte b/src/lib/components/channel/MessageInput.svelte index 061082c8c2..de00b80c63 100644 --- a/src/lib/components/channel/MessageInput.svelte +++ b/src/lib/components/channel/MessageInput.svelte @@ -334,8 +334,9 @@ // Convert the canvas to a Base64 image URL const imageUrl = canvas.toDataURL('image/png'); - // Add the captured image to the files array to render it - files = [...files, { type: 'image', url: imageUrl }]; + const blob = await (await fetch(imageUrl)).blob(); + const file = new File([blob], `screen-capture-${Date.now()}.png`, { type: 'image/png' }); + inputFilesHandler([file]); // Clean memory: Clear video srcObject video.srcObject = null; } catch (error) {