2
0

🐛 Fix empty placeholder ignored

Closes #1660
This commit is contained in:
Baptiste Arnaud
2024-07-22 17:37:32 +02:00
parent ec2a53fac1
commit 0237c6f835
4 changed files with 12 additions and 27 deletions

View File

@@ -162,8 +162,7 @@ export const startSession = async ({
typebot: {
id: typebot.id,
settings: deepParseVariables(
initialState.typebotsQueue[0].typebot.variables,
{ removeEmptyStrings: true }
initialState.typebotsQueue[0].typebot.variables
)(typebot.settings),
theme: sanitizeAndParseTheme(typebot.theme, {
variables: initialState.typebotsQueue[0].typebot.variables,
@@ -274,8 +273,7 @@ export const startSession = async ({
typebot: {
id: typebot.id,
settings: deepParseVariables(
newSessionState.typebotsQueue[0].typebot.variables,
{ removeEmptyStrings: true }
newSessionState.typebotsQueue[0].typebot.variables
)(typebot.settings),
theme: sanitizeAndParseTheme(typebot.theme, {
variables: initialState.typebotsQueue[0].typebot.variables,
@@ -293,8 +291,7 @@ export const startSession = async ({
typebot: {
id: typebot.id,
settings: deepParseVariables(
newSessionState.typebotsQueue[0].typebot.variables,
{ removeEmptyStrings: true }
newSessionState.typebotsQueue[0].typebot.variables
)(typebot.settings),
theme: sanitizeAndParseTheme(typebot.theme, {
variables: initialState.typebotsQueue[0].typebot.variables,
@@ -472,11 +469,9 @@ const sanitizeAndParseTheme = (
{ variables }: { variables: Variable[] }
): Theme => ({
general: theme.general
? deepParseVariables(variables, { removeEmptyStrings: true })(theme.general)
: undefined,
chat: theme.chat
? deepParseVariables(variables, { removeEmptyStrings: true })(theme.chat)
? deepParseVariables(variables)(theme.general)
: undefined,
chat: theme.chat ? deepParseVariables(variables)(theme.chat) : undefined,
customCss: theme.customCss
? removeLiteBadgeCss(parseVariables(variables)(theme.customCss))
: undefined,