mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 03:47:49 +01:00
fix: empty content in file modal
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
import Tooltip from './Tooltip.svelte';
|
||||
import dayjs from 'dayjs';
|
||||
import Spinner from './Spinner.svelte';
|
||||
import { getFileById } from '$lib/apis/files';
|
||||
|
||||
export let item;
|
||||
export let show = false;
|
||||
@@ -49,6 +50,18 @@
|
||||
item.files = knowledge.files || [];
|
||||
}
|
||||
loading = false;
|
||||
} else if (item?.type === 'file') {
|
||||
loading = true;
|
||||
|
||||
const file = await getFileById(localStorage.token, item.id).catch((e) => {
|
||||
console.error('Error fetching file:', e);
|
||||
return null;
|
||||
});
|
||||
|
||||
if (file) {
|
||||
item.file = file || {};
|
||||
}
|
||||
loading = false;
|
||||
}
|
||||
|
||||
await tick();
|
||||
|
||||
Reference in New Issue
Block a user