Fix first chat date injestion (I'm pretty sure).

This commit is contained in:
BlipRanger
2023-07-19 09:51:22 -04:00
parent 2f73506e25
commit 284fb68478
2 changed files with 6 additions and 5 deletions

View File

@@ -393,8 +393,9 @@ function calculateTotalGenTimeAndWordCount(
}
// If this is the first user message, set the first chat time
if (json.is_user && firstChatTime > Date.now()) {
firstChatTime = timestampToMoment(json.send_date);
if (json.is_user) {
//get min between firstChatTime and timestampToMoment(json.send_date)
firstChatTime = Math.min(timestampToMoment(json.send_date), firstChatTime);
}
} catch (error) {
console.error(`Error parsing line ${line}: ${error}`);