mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-28 06:22:33 +00:00
fix: insert images uploaded from the note menu (#32793)
This commit is contained in:
parent
312d113fd0
commit
4604f2a3bc
1 changed files with 14 additions and 2 deletions
|
|
@ -694,8 +694,20 @@ ${content}
|
|||
|
||||
input.onchange = async () => {
|
||||
const inputFiles = Array.from(input.files ?? []);
|
||||
if (inputFiles.length > 0) {
|
||||
await inputFilesHandler(inputFiles);
|
||||
for (const file of inputFiles) {
|
||||
const fileItem = await inputFileHandler(file);
|
||||
if (fileItem?.type === 'image' && editor) {
|
||||
editor
|
||||
.chain()
|
||||
.insertContentAt(editor.state.selection.$anchor.pos, {
|
||||
type: 'image',
|
||||
attrs: {
|
||||
src: `data://${fileItem.id}`
|
||||
}
|
||||
})
|
||||
.focus()
|
||||
.run();
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue