fix deletion logic
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
|
||||
import Flow from './Flow.svelte';
|
||||
|
||||
interface Props {
|
||||
let {
|
||||
data
|
||||
}: {
|
||||
data: { flowConfig: FlowConfig };
|
||||
}
|
||||
|
||||
let { data }: Props = $props();
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<SvelteFlowProvider>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { writable } from 'svelte/store';
|
||||
import { Background, Controls, MiniMap, Panel, SvelteFlow } from '@xyflow/svelte';
|
||||
|
||||
import '@xyflow/svelte/dist/style.css';
|
||||
@@ -11,13 +10,13 @@
|
||||
let { flowConfig }: Props = $props();
|
||||
|
||||
// Create writables here so it is easier to create test cases
|
||||
const nodes = writable(flowConfig.flowProps?.nodes);
|
||||
const edges = writable(flowConfig.flowProps?.edges);
|
||||
let nodes = $state.raw(flowConfig.flowProps?.nodes ?? []);
|
||||
let edges = $state.raw(flowConfig.flowProps?.edges ?? []);
|
||||
|
||||
const flowProps = { ...flowConfig.flowProps, nodes, edges };
|
||||
const flowProps = { ...flowConfig.flowProps };
|
||||
</script>
|
||||
|
||||
<SvelteFlow {...flowProps}>
|
||||
<SvelteFlow bind:nodes bind:edges {...flowProps}>
|
||||
{#if flowConfig.panelProps}
|
||||
<Panel {...flowConfig.panelProps} />
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user