🐛 Fix formatted message in input block when input is retried
This commit is contained in:
@@ -171,7 +171,7 @@ export const ConversationContainer = (props: Props) => {
|
||||
setFormattedMessages([
|
||||
...formattedMessages(),
|
||||
{
|
||||
inputId: [...chatChunks()].pop()?.input?.id ?? '',
|
||||
inputIndex: [...chatChunks()].length - 1,
|
||||
formattedMessage: data.lastMessageNewFormat as string,
|
||||
},
|
||||
])
|
||||
|
||||
@@ -63,8 +63,8 @@ export const InputChatBlock = (props: Props) => {
|
||||
}
|
||||
|
||||
createEffect(() => {
|
||||
const formattedMessage = formattedMessages().find(
|
||||
(message) => message.inputId === props.block.id
|
||||
const formattedMessage = formattedMessages().findLast(
|
||||
(message) => props.inputIndex === message.inputIndex
|
||||
)?.formattedMessage
|
||||
if (formattedMessage) setFormattedMessage(formattedMessage)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user