diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte
index 011afca87..117710023 100644
--- a/src/lib/components/chat/Chat.svelte
+++ b/src/lib/components/chat/Chat.svelte
@@ -1734,7 +1734,7 @@
// Skip this check if image generation is enabled, as images may be for editing or are generated outputs in the history
const hasImages = createMessagesList(_history, parentId).some((message) =>
message.files?.some(
- (file) => file.type === 'image' || file?.content_type?.startsWith('image/')
+ (file) => file.type === 'image' || (file?.content_type ?? '').startsWith('image/')
)
);
diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte
index 7c2273560..d2056554d 100644
--- a/src/lib/components/chat/Messages/ResponseMessage.svelte
+++ b/src/lib/components/chat/Messages/ResponseMessage.svelte
@@ -649,7 +649,7 @@
>
{#each message.files as file}
- {#if file.type === 'image'}
+ {#if file.type === 'image' || (file?.content_type ?? '').startsWith('image/')}
{:else}
0}
{#each editedFiles as file, fileIdx}
- {#if file.type === 'image'}
+ {#if file.type === 'image' || (file?.content_type ?? '').startsWith('image/')}
{/if}
{:else if typeof file === 'object'}
- {#if file.type === 'image' && file.url}
+ {#if (file.type === 'image' || (file?.content_type ?? '').startsWith('image/')) && file.url}
{
loading = true;
@@ -157,7 +159,7 @@
messages = [];
- if (res) {
+ if (res) {
note = res;
files = res.data.files || [];
@@ -780,7 +782,7 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
await tick();
for (const file of files) {
- if (file.type === 'image') {
+ if (file.type === 'image' || (file?.content_type ?? '').startsWith('image/')) {
const e = new CustomEvent('data', { files: files });
const img = document.getElementById(`image:${file.id}`);
diff --git a/src/lib/components/notes/NoteEditor/Controls.svelte b/src/lib/components/notes/NoteEditor/Controls.svelte
index 675056ee4..3d80425f7 100644
--- a/src/lib/components/notes/NoteEditor/Controls.svelte
+++ b/src/lib/components/notes/NoteEditor/Controls.svelte
@@ -68,7 +68,7 @@
{/each}
- {#each files.filter((file) => file.type === 'image') as file, fileIdx}
+ {#each files.filter((file) => file.type === 'image' || (file?.content_type ?? '').startsWith('image/')) as file, fileIdx}