diff --git a/packages/bot-engine/src/contexts/TypebotContext.tsx b/packages/bot-engine/src/contexts/TypebotContext.tsx index 3097f98d00..e2818ae88f 100644 --- a/packages/bot-engine/src/contexts/TypebotContext.tsx +++ b/packages/bot-engine/src/contexts/TypebotContext.tsx @@ -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) => ({ diff --git a/packages/bot-engine/src/services/chat.ts b/packages/bot-engine/src/services/chat.ts index 311bb35c54..aadfada994 100644 --- a/packages/bot-engine/src/services/chat.ts +++ b/packages/bot-engine/src/services/chat.ts @@ -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