Skip to content

Commit

Permalink
fix(engine): 🐛 Typing emulation on arabic chars
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 23, 2022
1 parent 1dc2264 commit b6618ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/bot-engine/src/contexts/TypebotContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ export const TypebotContext = ({
setLocalTypebot((localTypebot) => ({
...localTypebot,
theme: typebot.theme,
settings: typebot.settings,
}))
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [typebot.theme])
}, [typebot.theme, typebot.settings])

const updateVariableValue = (variableId: string, value: string) => {
setLocalTypebot((typebot) => ({
Expand Down
3 changes: 2 additions & 1 deletion packages/bot-engine/src/services/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export const computeTypingTimeout = (
bubbleContent: string,
typingSettings: TypingEmulation
) => {
const wordCount = bubbleContent.match(/(\w+)/g)?.length ?? 0
let wordCount = bubbleContent.match(/(\w+)/g)?.length ?? 0
if (wordCount === 0) wordCount = bubbleContent.length
const typedWordsPerMinute = typingSettings.speed
let typingTimeout = typingSettings.enabled
? (wordCount / typedWordsPerMinute) * 60000
Expand Down

2 comments on commit b6618ba

@vercel
Copy link

@vercel vercel bot commented on b6618ba Feb 23, 2022

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on b6618ba Feb 23, 2022

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-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io

Please sign in to comment.