mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 19:02:23 +08:00
fix: 🚑 replace problematic attachment count (#13416)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved attachment handling in chat by updating the way attachments are counted, ensuring only files and images are included. Document attachments are no longer counted in this process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -171,7 +171,7 @@ private extension ChatManager {
|
|||||||
]
|
]
|
||||||
let attachmentCount = [
|
let attachmentCount = [
|
||||||
editorData.fileAttachments.count,
|
editorData.fileAttachments.count,
|
||||||
editorData.documentAttachments.count,
|
editorData.imageAttachments.count,
|
||||||
].reduce(0, +)
|
].reduce(0, +)
|
||||||
let attachmentFieldName = attachmentCount > 1 && attachmentCount != 0 ? "options.blobs" : "options.blob"
|
let attachmentFieldName = attachmentCount > 1 && attachmentCount != 0 ? "options.blobs" : "options.blob"
|
||||||
let uploadableAttachments: [GraphQLFile] = [
|
let uploadableAttachments: [GraphQLFile] = [
|
||||||
|
|||||||
Reference in New Issue
Block a user