fix(chat): normalize message date headers
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
import { setup, assign } from "xstate";
|
||||
|
||||
import { ChatStorage } from "@/data/storage/chat/chat_storage";
|
||||
import { formatDate, todayString, Logger } from "@/utils";
|
||||
import { todayString, Logger } from "@/utils";
|
||||
|
||||
import { ChatState, initialState } from "./chat-state";
|
||||
import type { ChatEvent } from "./chat-events";
|
||||
@@ -229,7 +229,7 @@ export const chatMachine = setup({
|
||||
messages.push({
|
||||
content: event.text,
|
||||
isFromAI: true,
|
||||
date: formatDate(),
|
||||
date: todayString(),
|
||||
});
|
||||
} else {
|
||||
const last = messages[messages.length - 1];
|
||||
@@ -255,7 +255,7 @@ export const chatMachine = setup({
|
||||
{
|
||||
content: "Something went wrong. Try sending again?",
|
||||
isFromAI: true,
|
||||
date: formatDate(),
|
||||
date: todayString(),
|
||||
},
|
||||
];
|
||||
return { messages, isReplyingAI: false };
|
||||
|
||||
Reference in New Issue
Block a user