Run fitView after 50 milliseconds because it didn't run in some cases.

This commit is contained in:
Ivan Vasilov committed 2024-01-18 18:07:51 +01:00
1 parent a976286e71
commit 5affe6aaf1
1 file changed
+1 -1
@@ -46,7 +46,7 @@ const SchemaFlowHandler = ({ content }: SchemaGraphProps) => {
getGraphDataFromTables(tables).then(({ nodes, edges }) => {
reactFlowInstance.setNodes(nodes)
reactFlowInstance.setEdges(edges)
setTimeout(() => reactFlowInstance.fitView({}), 10)
setTimeout(() => reactFlowInstance.fitView({}), 50)
})
}, [tables, resolvedTheme, reactFlowInstance])