mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 22:10:21 +08:00
fix: include image files in block retrieval for improved file handling (#7231)
This commit is contained in:
parent
d31980a2dc
commit
34fcf73a95
@ -196,7 +196,10 @@ export const cleanupMultipleBlocks = (dispatch: AppDispatch, blockIds: string[])
|
|||||||
|
|
||||||
const getBlocksFiles = async (blockIds: string[]) => {
|
const getBlocksFiles = async (blockIds: string[]) => {
|
||||||
const blocks = await db.message_blocks.where('id').anyOf(blockIds).toArray()
|
const blocks = await db.message_blocks.where('id').anyOf(blockIds).toArray()
|
||||||
const files = blocks.filter((block) => block.type === MessageBlockType.FILE).map((block) => block.file)
|
const files = blocks
|
||||||
|
.filter((block) => block.type === MessageBlockType.FILE || block.type === MessageBlockType.IMAGE)
|
||||||
|
.map((block) => block.file)
|
||||||
|
.filter((file): file is FileType => file !== undefined)
|
||||||
return isEmpty(files) ? [] : files
|
return isEmpty(files) ? [] : files
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user