diff --git a/packages/nc-gui/components/erd/SimpleView.vue b/packages/nc-gui/components/erd/SimpleView.vue index 336ba6d63f..1248fbb0c6 100644 --- a/packages/nc-gui/components/erd/SimpleView.vue +++ b/packages/nc-gui/components/erd/SimpleView.vue @@ -24,8 +24,6 @@ const { metasWithIdAsKey } = useMetas() const { $destroy, fitView } = useVueFlow() -const isTransitioning = ref(true) - const nodes = ref([]) const edges = ref([]) @@ -179,57 +177,49 @@ const layoutNodes = () => { }) } -const init = (reset = false) => { +const init = () => { initDagre() populateInitialNodes() populateEdges() layoutNodes() - if (reset) { - setTimeout(() => fitView({ duration: 300 })) - } + setTimeout(() => fitView({ duration: 300 })) } init() onScopeDispose($destroy) -watch([() => tables, () => config], () => init(true), { deep: true, flush: 'pre' }) - -useEventListener('transitionend', () => { - isTransitioning.value = false -}) +watch([() => tables, () => config], init, { deep: true, flush: 'pre' })