From ce32fd32b6d28357977cc40ff781126e50e3c4c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E7=94=B1=E7=9A=84=E4=B8=96=E7=95=8C=E4=BA=BA?= <3196812536@qq.com> Date: Mon, 16 Jun 2025 12:04:45 +0800 Subject: [PATCH] fix: include image files in block retrieval for improved file handling (#7231) --- src/renderer/src/store/thunk/messageThunk.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/store/thunk/messageThunk.ts b/src/renderer/src/store/thunk/messageThunk.ts index 17487ad69b..afab876195 100644 --- a/src/renderer/src/store/thunk/messageThunk.ts +++ b/src/renderer/src/store/thunk/messageThunk.ts @@ -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 }