diff --git a/apps/builder/src/components/ImageUploadContent/UnsplashPicker.tsx b/apps/builder/src/components/ImageUploadContent/UnsplashPicker.tsx index fc2e277d145..7b683f7ecac 100644 --- a/apps/builder/src/components/ImageUploadContent/UnsplashPicker.tsx +++ b/apps/builder/src/components/ImageUploadContent/UnsplashPicker.tsx @@ -42,7 +42,6 @@ export const UnsplashPicker = ({ imageSize, onImageSelect }: Props) => { const [nextPage, setNextPage] = useState(0) const fetchNewImages = useCallback(async (query: string, page: number) => { - console.log('Fetch images', query, page) if (query === '') return searchRandomImages() if (query.length <= 2) return setError(null) @@ -76,7 +75,6 @@ export const UnsplashPicker = ({ imageSize, onImageSelect }: Props) => { if (!bottomAnchor.current) return const observer = new IntersectionObserver( (entities: IntersectionObserverEntry[]) => { - console.log('Intersection observer', entities) const target = entities[0] if (target.isIntersecting) fetchNewImages(searchQuery, nextPage + 1) }, diff --git a/apps/builder/src/features/blocks/logic/setVariable/components/SetVariableSettings.tsx b/apps/builder/src/features/blocks/logic/setVariable/components/SetVariableSettings.tsx index fb56a55d29d..a9e2aecb3c2 100644 --- a/apps/builder/src/features/blocks/logic/setVariable/components/SetVariableSettings.tsx +++ b/apps/builder/src/features/blocks/logic/setVariable/components/SetVariableSettings.tsx @@ -4,6 +4,7 @@ import { SetVariableOptions, Variable } from '@typebot.io/schemas' import React from 'react' import { VariableSearchInput } from '@/components/inputs/VariableSearchInput' import { Textarea } from '@/components/inputs' +import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel' type Props = { options: SetVariableOptions @@ -11,16 +12,24 @@ type Props = { } export const SetVariableSettings = ({ options, onOptionsChange }: Props) => { - const handleVariableChange = (variable?: Variable) => + const updateVariableId = (variable?: Variable) => onOptionsChange({ ...options, variableId: variable?.id }) - const handleExpressionChange = (expressionToEvaluate: string) => + + const updateExpression = (expressionToEvaluate: string) => onOptionsChange({ ...options, expressionToEvaluate }) - const handleValueTypeChange = () => + + const updateExpressionType = () => onOptionsChange({ ...options, isCode: options.isCode ? !options.isCode : true, }) + const updateClientExecution = (isExecutedOnClient: boolean) => + onOptionsChange({ + ...options, + isExecutedOnClient, + }) + return ( @@ -28,7 +37,7 @@ export const SetVariableSettings = ({ options, onOptionsChange }: Props) => { Search or create variable: @@ -43,7 +52,7 @@ export const SetVariableSettings = ({ options, onOptionsChange }: Props) => { Code @@ -52,17 +61,23 @@ export const SetVariableSettings = ({ options, onOptionsChange }: Props) => { {options.isCode ?? false ? ( ) : (