auto-git:

[change] src/App.jsx
This commit is contained in:
2026-05-06 03:51:29 +02:00
parent 54048acdcd
commit a89dd5e13d

View File

@@ -181,33 +181,6 @@ export default function App() {
}
}
function setAssistantMessageContent(sessionId, messageId, content, options = {}) {
const { removeIfEmpty = false } = options
setChatSessions(prevSessions =>
prevSessions.map(session => {
if (session.session_id !== sessionId) return session
const nextMessages = []
for (const message of session.messages || []) {
if (message.id !== messageId) {
nextMessages.push(message)
continue
}
if (removeIfEmpty && !content) continue
nextMessages.push({ ...message, content })
}
return { ...session, messages: nextMessages }
})
)
}
function messageHasImageAttachments(message) {
return Array.isArray(message?.attachments) && message.attachments.some(attachmentIsImage)
}
async function syncVisionModelFromChatModel(nextModel, options = {}) {
const { allowCapabilityLookup = true } = options
if (!nextModel) {
@@ -252,16 +225,6 @@ export default function App() {
await syncVisionModelFromChatModel(nextModel)
}
function buildAttachmentTitleSeed(text, attachments = []) {
const trimmed = String(text || '').trim()
if (trimmed) {
return trimmed
}
const firstAttachment = Array.isArray(attachments) ? attachments[0] : null
const firstName = getAttachmentDisplayName(firstAttachment, '')
return firstName || 'Attachment'
}
function appendComposerFileAttachments(attachments) {
if (!Array.isArray(attachments) || attachments.length === 0) {
return