💄 Fix audio element UI overflow on Firefox
Also added better display when a media bubble src is a variable Closes #1742
This commit is contained in:
@ -13,7 +13,7 @@ import Mail from 'nodemailer/lib/mailer'
|
||||
import { byId, isDefined, isEmpty, isNotDefined, omit } from '@typebot.io/lib'
|
||||
import { decrypt } from '@typebot.io/lib/api/encryption/decrypt'
|
||||
import { defaultFrom, defaultTransportOptions } from './constants'
|
||||
import { findUniqueVariableValue } from '@typebot.io/variables/findUniqueVariableValue'
|
||||
import { findUniqueVariable } from '@typebot.io/variables/findUniqueVariableValue'
|
||||
import { env } from '@typebot.io/env'
|
||||
import { ExecuteIntegrationResponse } from '../../../types'
|
||||
import prisma from '@typebot.io/lib/prisma'
|
||||
@ -43,9 +43,9 @@ export const executeSendEmailBlock = async (
|
||||
],
|
||||
}
|
||||
|
||||
const bodyUniqueVariable = findUniqueVariableValue(typebot.variables)(
|
||||
const bodyUniqueVariable = findUniqueVariable(typebot.variables)(
|
||||
options?.body
|
||||
)
|
||||
)?.value
|
||||
const body = bodyUniqueVariable
|
||||
? stringifyUniqueVariableValueAsHtml(bodyUniqueVariable)
|
||||
: parseVariables(typebot.variables, { isInsideHtml: !options?.isBodyCode })(
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { isNotDefined, isDefined } from '@typebot.io/lib'
|
||||
import { Comparison, Condition, Variable } from '@typebot.io/schemas'
|
||||
import { findUniqueVariableValue } from '@typebot.io/variables/findUniqueVariableValue'
|
||||
import { findUniqueVariable } from '@typebot.io/variables/findUniqueVariableValue'
|
||||
import { parseVariables } from '@typebot.io/variables/parseVariables'
|
||||
import {
|
||||
LogicalOperator,
|
||||
@ -30,7 +30,7 @@ const executeComparison =
|
||||
const value =
|
||||
comparison.value === 'undefined' || comparison.value === 'null'
|
||||
? null
|
||||
: findUniqueVariableValue(variables)(comparison.value) ??
|
||||
: findUniqueVariable(variables)(comparison.value)?.value ??
|
||||
parseVariables(variables)(comparison.value)
|
||||
if (isNotDefined(comparison.comparisonOperator)) return false
|
||||
switch (comparison.comparisonOperator) {
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { Variable } from './types'
|
||||
|
||||
export const findUniqueVariableValue =
|
||||
export const findUniqueVariable =
|
||||
(variables: Variable[]) =>
|
||||
(value: string | undefined): Variable['value'] => {
|
||||
(value: string | undefined): Variable | null => {
|
||||
if (!value || !value.startsWith('{{') || !value.endsWith('}}')) return null
|
||||
const variableName = value.slice(2, -2)
|
||||
const variable = variables.find(
|
||||
(variable) => variable.name === variableName
|
||||
)
|
||||
return variable?.value ?? null
|
||||
return variable ?? null
|
||||
}
|
||||
|
Reference in New Issue
Block a user