2
0

🐛 (bot) Fix input prefill when linked to another typebot

This commit is contained in:
Baptiste Arnaud
2022-11-22 08:14:25 +01:00
parent bd7db62f71
commit 5619eef459

View File

@ -41,8 +41,11 @@ export const InputChatBlock = ({
const { variableId } = block.options
const defaultValue =
typebot.settings.general.isInputPrefillEnabled ?? true
? variableId && typebot.variables.find(byId(variableId))?.value
(typebot.settings.general.isInputPrefillEnabled ?? true) && variableId
? typebot.variables.find(
(variable) =>
variable.name === typebot.variables.find(byId(variableId))?.name
)?.value
: undefined
const handleSubmit = async ({ label, value, itemId }: InputSubmitContent) => {