handle revert to static better for apps

This commit is contained in:
Ruben Fiszel
2023-05-10 09:39:39 +02:00
parent 4c3151dfdc
commit 79860fd00e
2 changed files with 10 additions and 2 deletions

View File

@@ -15,7 +15,7 @@
import { computeGlobalContext, eval_like } from './eval'
import InputValue from './InputValue.svelte'
import RefreshButton from './RefreshButton.svelte'
import { selectId } from '../../editor/appUtils'
import { clearErrorByComponentId, selectId } from '../../editor/appUtils'
// Component props
export let id: string
@@ -365,6 +365,9 @@
onDestroy(() => {
$initialized.initializedComponents = $initialized.initializedComponents.filter((c) => c !== id)
$errorByComponent = clearErrorByComponentId(id, $errorByComponent)
delete $runnableComponents[id]
$runnableComponents = $runnableComponents
})
</script>

View File

@@ -24,7 +24,12 @@
{#if componentInput.fieldType !== 'any'}
<div class="w-full">
<div class="mx-auto" bind:clientWidth>
<ToggleButtonGroup on:selected={() => onchange?.()} bind:selected={componentInput.type}>
<ToggleButtonGroup
on:selected={() => {
onchange?.()
}}
bind:selected={componentInput.type}
>
{#if componentInput.fieldType === 'template'}
<ToggleButton
tooltip={`Templated string (use \$\{<output>.x\} )`}