Skip to content

Commit

Permalink
🐛 Fix formatted message in input block when input is retried
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Nov 1, 2023
1 parent 585e1d4 commit a564181
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/embeds/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.2.10",
"version": "0.2.11",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
])
Expand Down
4 changes: 2 additions & 2 deletions packages/embeds/js/src/components/InputChatBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/js/src/utils/formattedMessagesSignal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSignal } from 'solid-js'

export const [formattedMessages, setFormattedMessages] = createSignal<
{ inputId: string; formattedMessage: string }[]
{ inputIndex: number; formattedMessage: string }[]
>([])
2 changes: 1 addition & 1 deletion packages/embeds/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.2.10",
"version": "0.2.11",
"description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.2.10",
"version": "0.2.11",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

4 comments on commit a564181

@vercel
Copy link

@vercel vercel bot commented on a564181 Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viewer-v2 – ./apps/viewer

bii.bj
1stop.au
houss.io
x.cr8.ai
bot.dsignagency.com
bot.enthrallart.com
bot.eventhub.com.au
bot.febredojogo.com
bot.gravityatoms.in
bot.jepierre.com.br
bot.jogodoandre.com
bot.jogomoderno.com
bot.ltmidias.com.br
bot.viralsangat.com
bot.winglabs.com.br
bt.scadiagro.com.br
capitaldigital.live
carsalesenquiry.com
casahackeada.online
chat.jubahkonvo.com
chat.marius.digital
chat.mosdent.com.tr
chat.rahsiakami.com
chat.sr7digital.com
chatbot.matthesv.de
chatbot.repplai.com
chatwebandreia.site
co.onewebcenter.com
cr.onewebcenter.com
danielmentality.com
demo.botscientis.us
demo.newaiguide.com
demo.wemakebots.xyz
feiralimpanomes.com
go.onewebcenter.com
gv.onewebcenter.com
hrbot.robomotion.io
inearephones.cr8.ai
joaomigowski.com.br
kbsub.wpwakanda.com
limitenahora.com.br
live.botscientis.us
lojasbloombelle.com
mentoria.omelhor.vc
messengerbet.online
noticiariododia.com
nutrisamirbayde.com
online.onlinmey.com
portaldosganhos.com
query.forgetsql.com
quest.wpwakanda.com
se.onewebcenter.com
secretespiao.online
start.belenmotz.com
support.wawplus.com
survey1.digienge.io
surveys.essiell.com
tanya.bangben.my.id
test.botscientis.us
test.reventepro.com
typebot.stillio.app
typebot.stillio.com
vg.onewebcenter.com
wa.onewebcenter.com
web.draleticiah.com
whatsdigital.online
wordsandimagery.com
88584434.therpm.club
92109660.therpm.club
app.horadelucrar.com
app.whatisappweb.com
aprendendojuntos.app
assistent.m-vogel.de
ativandograna.online
bium.gratirabbit.com
bot.ansuraniphone.my
bot.barrettamario.it
bot.buenanoticia.fun
bot.conhecaojogo.com
bot.cotemeuplano.com
bot.gameincrivel.com
bot.gamesimples.club
bot.grupodojo.com.br
bot.jogodofuturo.com
bot.jogoquelucra.com
bot.mycompay.reviews
bot.projetodashi.com
bot.socialcliques.me
bt.49educacao.com.br
cha.onewebcenter.com
chat.febredojogo.com
chat.gnipharmahq.com
chat.hayurihijab.com
chat.jottagreens.com
chatbee.agfunnel.com
click.sevenoways.com
compleat.jetdigi.com
connect.growthguy.in
detetivepatricia.com
drapamela.gikpro.com

@vercel
Copy link

@vercel vercel bot commented on a564181 Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on a564181 Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./apps/docs

docs-typebot-io.vercel.app
docs-git-main-typebot-io.vercel.app
docs.typebot.io

@vercel
Copy link

@vercel vercel bot commented on a564181 Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.