fix: include image files in block retrieval for improved file handling (#7231)

This commit is contained in:
自由的世界人 2025-06-16 12:04:45 +08:00 committed by GitHub
parent d31980a2dc
commit 34fcf73a95

View File

@ -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
}