From 56c181795602e5aaea8b80f0cb42cfba494ba1e7 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 20 Mar 2023 14:01:34 +0100 Subject: [PATCH] fix preview of ontextfocus --- frontend/CaddyfileRemote | 2 +- .../lib/components/apps/components/display/AppText.svelte | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/CaddyfileRemote b/frontend/CaddyfileRemote index fceb5be316..ec6abd6d34 100644 --- a/frontend/CaddyfileRemote +++ b/frontend/CaddyfileRemote @@ -1,6 +1,6 @@ http://localhost { bind {$ADDRESS} - reverse_proxy /api/* https://app.windmill.dev { + reverse_proxy /api/* https://teracapital.windmill.dev { header_up Host {http.reverse_proxy.upstream.hostport} header_down Set-Cookie windmill.dev localhost } diff --git a/frontend/src/lib/components/apps/components/display/AppText.svelte b/frontend/src/lib/components/apps/components/display/AppText.svelte index 9fcaf0ca2f..aab9c5a0f3 100644 --- a/frontend/src/lib/components/apps/components/display/AppText.svelte +++ b/frontend/src/lib/components/apps/components/display/AppText.svelte @@ -17,6 +17,7 @@ import { getContext } from 'svelte' import { initOutput } from '../../editor/appUtils' import Tooltip from '$lib/components/Tooltip.svelte' + import { get } from 'svelte/store' export let id: string export let componentInput: AppInput | undefined @@ -29,7 +30,7 @@ const { app, worldStore, mode } = getContext('AppViewerContext') - const { ontextfocus } = getContext('AppEditorContext') + const editorcontext = getContext('AppEditorContext') const outputs = initOutput($worldStore, id, { result: undefined, @@ -94,7 +95,10 @@ : ''}" on:click={() => { if ($mode === 'dnd' && componentInput?.type == 'template') { - $ontextfocus?.() + let ontextfocus = editorcontext?.ontextfocus + if (ontextfocus) { + get(ontextfocus)?.() + } } }} >