mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +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 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
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user