fix(chat): stabilize message identities
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
finishPendingReply,
|
||||
type HttpSendOutput,
|
||||
} from "../helper/send-state";
|
||||
import { createClientUiMessageIdentity } from "../ui-message";
|
||||
import { historyMachineSetup } from "./history-flow";
|
||||
import { createChatActorActionSetup } from "./setup";
|
||||
|
||||
@@ -36,6 +37,7 @@ const appendGuestUserMessageAction = historyMachineSetup.assign(
|
||||
messages: [
|
||||
...context.messages,
|
||||
{
|
||||
...createClientUiMessageIdentity("message"),
|
||||
content: event.content,
|
||||
isFromAI: false,
|
||||
date: today,
|
||||
@@ -63,6 +65,7 @@ const appendUserMessageAction = historyMachineSetup.assign(
|
||||
messages: [
|
||||
...context.messages,
|
||||
{
|
||||
...createClientUiMessageIdentity("message"),
|
||||
content: event.content,
|
||||
isFromAI: false,
|
||||
date: today,
|
||||
@@ -83,6 +86,7 @@ const appendQueuedSendErrorMessageAction = historyMachineSetup.assign(
|
||||
const messages = [
|
||||
...context.messages,
|
||||
{
|
||||
...createClientUiMessageIdentity("error"),
|
||||
content: unavailable
|
||||
? "This character is temporarily unavailable. Please try again shortly."
|
||||
: "Something went wrong. Try sending again?",
|
||||
@@ -135,6 +139,7 @@ const appendGuestUserImageAction = historyMachineSetup.assign(
|
||||
messages: [
|
||||
...context.messages,
|
||||
{
|
||||
...createClientUiMessageIdentity("image"),
|
||||
content: "[Image]",
|
||||
isFromAI: false,
|
||||
date: today,
|
||||
@@ -162,6 +167,7 @@ const appendUserImageAction = historyMachineSetup.assign(
|
||||
messages: [
|
||||
...context.messages,
|
||||
{
|
||||
...createClientUiMessageIdentity("image"),
|
||||
content: "[Image]",
|
||||
isFromAI: false,
|
||||
date: today,
|
||||
|
||||
Reference in New Issue
Block a user