2
0

fix(engine): 🐛 Score addition

This commit is contained in:
Baptiste Arnaud
2022-05-22 07:45:47 -07:00
parent 62162c6c2a
commit 1bb89527d5

View File

@ -67,10 +67,13 @@ export const TypebotContext = ({
}, [typebot.theme, typebot.settings])
const updateVariableValue = (variableId: string, value: string) => {
const formattedValue: string | number = isNaN(Number(value))
? value
: Number(value)
setLocalTypebot((typebot) => ({
...typebot,
variables: typebot.variables.map((v) =>
v.id === variableId ? { ...v, value } : v
v.id === variableId ? { ...v, value: formattedValue } : v
),
}))
}