diff --git a/src/lib/components/channel/MessageInput.svelte b/src/lib/components/channel/MessageInput.svelte index 105e46a79..7615a8e03 100644 --- a/src/lib/components/channel/MessageInput.svelte +++ b/src/lib/components/channel/MessageInput.svelte @@ -398,7 +398,7 @@ dir={$settings?.chatDirection ?? 'LTR'} > {#if files.length > 0} -
+
{#each files as file, fileIdx} {#if file.type === 'image'}
@@ -411,7 +411,7 @@
{/if} -
+
diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index ef12211d5..f84a3f1ee 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -573,7 +573,7 @@ dir={$settings?.chatDirection ?? 'LTR'} > {#if files.length > 0} -
+
{#each files as file, fileIdx} {#if file.type === 'image'}
@@ -611,7 +611,7 @@
{/if} -
+
{#if $settings?.richTextInput ?? true}
{ filesInputElement.click(); }} diff --git a/src/lib/components/chat/MessageInput/InputMenu.svelte b/src/lib/components/chat/MessageInput/InputMenu.svelte index faa14a9a7..4a7624cfe 100644 --- a/src/lib/components/chat/MessageInput/InputMenu.svelte +++ b/src/lib/components/chat/MessageInput/InputMenu.svelte @@ -21,12 +21,12 @@ export let screenCaptureHandler: Function; export let uploadFilesHandler: Function; + export let inputFilesHandler: Function; + export let uploadGoogleDriveHandler: Function; export let selectedToolIds: string[] = []; - export let codeInterpreterEnabled: boolean; - export let onClose: Function; let tools = {}; @@ -53,8 +53,26 @@ return a; }, {}); }; + + function handleFileChange(event) { + const inputFiles = Array.from(event.target?.files); + if (inputFiles && inputFiles.length > 0) { + console.log(inputFiles); + inputFilesHandler(inputFiles); + } + } + + + { @@ -120,26 +138,32 @@
{/if} - {#if !$mobile} - - { - if (fileUploadEnabled) { + + { + if (fileUploadEnabled) { + if (!$mobile) { screenCaptureHandler(); + } else { + const cameraInputElement = document.getElementById('camera-input'); + + if (cameraInputElement) { + cameraInputElement.click(); + } } - }} - > - -
{$i18n.t('Capture')}
-
-
- {/if} + } + }} + > + +
{$i18n.t('Capture')}
+
+