mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
fix: empty content in file modal
This commit is contained in:
parent
c61698efcf
commit
630cea105e
1 changed files with 13 additions and 0 deletions
|
|
@ -13,6 +13,7 @@
|
||||||
import Tooltip from './Tooltip.svelte';
|
import Tooltip from './Tooltip.svelte';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import Spinner from './Spinner.svelte';
|
import Spinner from './Spinner.svelte';
|
||||||
|
import { getFileById } from '$lib/apis/files';
|
||||||
|
|
||||||
export let item;
|
export let item;
|
||||||
export let show = false;
|
export let show = false;
|
||||||
|
|
@ -49,6 +50,18 @@
|
||||||
item.files = knowledge.files || [];
|
item.files = knowledge.files || [];
|
||||||
}
|
}
|
||||||
loading = false;
|
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();
|
await tick();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue