From 84adb837090be4ba1e7bda1fb2eafe56fe07ecf7 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 25 May 2023 21:29:31 +0200 Subject: [PATCH] revert rx modification --- .../apps/components/helpers/InputValue.svelte | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/frontend/src/lib/components/apps/components/helpers/InputValue.svelte b/frontend/src/lib/components/apps/components/helpers/InputValue.svelte index 728bbc51de..ec39fc0bf4 100644 --- a/frontend/src/lib/components/apps/components/helpers/InputValue.svelte +++ b/frontend/src/lib/components/apps/components/helpers/InputValue.svelte @@ -72,22 +72,28 @@ $: lastInput && $worldStore && debounce(handleConnection) - const reEvalTemplate = async () => { - let nvalue = await getValue(lastInput) - if (!deepEqual(nvalue, value)) { - value = nvalue - } - } + $: lastInput && + lastInput.type == 'template' && + $stateId && + $state && + debounce(async () => { + let nvalue = await getValue(lastInput) + if (!deepEqual(nvalue, value)) { + value = nvalue + } + dispatch('done') + }) - $: lastInput && lastInput.type == 'template' && $stateId && $state && debounce(reEvalTemplate) - - const reEval = async () => { - let nvalue = await evalExpr(lastInput) - if (!deepEqual(nvalue, value)) { - value = nvalue - } - } - $: lastInput && lastInput.type == 'eval' && $stateId && $state && debounce2(reEval) + $: lastInput && + lastInput.type == 'eval' && + $stateId && + $state && + debounce2(async () => { + let nvalue = await evalExpr(lastInput) + if (!deepEqual(nvalue, value)) { + value = nvalue + } + }) async function handleConnection() { if (lastInput?.type === 'connected') {