fix(engine): 🐛 Typing emulation on arabic chars
This commit is contained in:
@ -34,9 +34,10 @@ export const TypebotContext = ({
|
|||||||
setLocalTypebot((localTypebot) => ({
|
setLocalTypebot((localTypebot) => ({
|
||||||
...localTypebot,
|
...localTypebot,
|
||||||
theme: typebot.theme,
|
theme: typebot.theme,
|
||||||
|
settings: typebot.settings,
|
||||||
}))
|
}))
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [typebot.theme])
|
}, [typebot.theme, typebot.settings])
|
||||||
|
|
||||||
const updateVariableValue = (variableId: string, value: string) => {
|
const updateVariableValue = (variableId: string, value: string) => {
|
||||||
setLocalTypebot((typebot) => ({
|
setLocalTypebot((typebot) => ({
|
||||||
|
@ -4,7 +4,8 @@ export const computeTypingTimeout = (
|
|||||||
bubbleContent: string,
|
bubbleContent: string,
|
||||||
typingSettings: TypingEmulation
|
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
|
const typedWordsPerMinute = typingSettings.speed
|
||||||
let typingTimeout = typingSettings.enabled
|
let typingTimeout = typingSettings.enabled
|
||||||
? (wordCount / typedWordsPerMinute) * 60000
|
? (wordCount / typedWordsPerMinute) * 60000
|
||||||
|
Reference in New Issue
Block a user