fix height refresh for flows (#5215)

This commit is contained in:
Guilhem
2025-02-05 16:27:11 +00:00
committed by GitHub
parent 645be25bef
commit 1e5cd282d7

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import { FlowService, type FlowModule } from '../../gen'
import { NODE, type GraphModuleState } from '.'
import { createEventDispatcher, getContext, onDestroy, onMount, setContext } from 'svelte'
import { createEventDispatcher, getContext, onDestroy, onMount, setContext, tick } from 'svelte'
import { get, writable, type Writable } from 'svelte/store'
import '@xyflow/svelte/dist/style.css'
@@ -273,7 +273,7 @@
return false
}
function updateStores() {
async function updateStores() {
if (graph.error) {
return
}
@@ -281,6 +281,7 @@
$nodes = layoutNodes(newGraph.nodes)
$edges = newGraph.edges
await tick()
height = Math.max(...$nodes.map((n) => n.position.y + NODE.height + 100), minHeight)
}