update: dont render nodes, edges if dimensions dont return a truthy value

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-20 03:18:09 +01:00
parent 68b7d99a9c
commit 2b87d53c10
4 changed files with 73 additions and 93 deletions
@@ -1,6 +1,5 @@
<script lang="ts" setup>
import { CSSProperties } from 'vue'
import { invoke } from '@vueuse/core'
import { ConnectionLineType } from '../../types'
import { useStore } from '../../composables'
import Edge from '../../components/Edges/Edge.vue'
@@ -23,11 +22,6 @@ const props = withDefaults(defineProps<EdgeRendererProps>(), {
const store = useStore()
invoke(async () => {
await until(store.getNodes).toMatch((y) => y && y.length > 0)
await until(store.transform).toMatch(([x, y, z]) => !isNaN(x) && x !== 0 && !isNaN(y) && y !== 0 && isNaN(z) && z !== 1)
})
const sourceNode = computed(() => store.nodes.find((n) => n.id === store.connectionNodeId))
const connectionLineVisible = computed(
() => !!(store.nodesConnectable && sourceNode.value && store.connectionNodeId && store.connectionHandleType),