From 482564528a8dd2727bdcca63c1acbee87d502d33 Mon Sep 17 00:00:00 2001 From: dal Date: Wed, 23 Jul 2025 16:56:32 -0600 Subject: [PATCH] lint fixes --- .../queries/messages/chatConversationHistory.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/database/src/queries/messages/chatConversationHistory.ts b/packages/database/src/queries/messages/chatConversationHistory.ts index 328620088..732be81e6 100644 --- a/packages/database/src/queries/messages/chatConversationHistory.ts +++ b/packages/database/src/queries/messages/chatConversationHistory.ts @@ -73,20 +73,22 @@ function getMostRecentRawLlmMessages( // We iterate backwards to find the most recent valid message for (let i = chatMessages.length - 1; i >= 0; i--) { const message = chatMessages[i]; - + // Skip if message is not completed if (!message?.isCompleted) { continue; } - + // Skip if rawLlmMessages is empty, null, or default empty object const rawMessages = message.rawLlmMessages; - if (!rawMessages || - (typeof rawMessages === 'object' && Object.keys(rawMessages).length === 0) || - rawMessages === '{}') { + if ( + !rawMessages || + (typeof rawMessages === 'object' && Object.keys(rawMessages).length === 0) || + rawMessages === '{}' + ) { continue; } - + // Check if it's a valid array if (Array.isArray(rawMessages) && rawMessages.length > 0) { return rawMessages as CoreMessage[];