refactor(edges): Remove get type call for names

This commit is contained in:
Braks
2022-05-27 23:36:01 +02:00
parent f9671b1ec4
commit 4cb4d9c0f4
@@ -24,18 +24,15 @@ const {
} = $(useVueFlow()) } = $(useVueFlow())
const sourceNode = $( const sourceNode = $(
controlledComputed( controlledComputed($$(connectionNodeId), () => {
() => connectionNodeId, if (connectionNodeId) return getNode(connectionNodeId)
() => { return false
if (connectionNodeId) return getNode(connectionNodeId) }),
return false
},
),
) )
const connectionLineVisible = $( const connectionLineVisible = $(
controlledComputed( controlledComputed(
() => connectionNodeId, $$(connectionNodeId),
() => () =>
!!( !!(
sourceNode && sourceNode &&
@@ -101,7 +98,7 @@ export default {
:id="edge.id" :id="edge.id"
:key="edge.id" :key="edge.id"
:edge="edge" :edge="edge"
:name="getType(edge) ? edge.type ?? 'default' : 'default'" :name="edge.type || 'default'"
:type="getType(edge)" :type="getType(edge)"
:selectable="typeof edge.selectable === 'undefined' ? elementsSelectable : edge.selectable" :selectable="typeof edge.selectable === 'undefined' ? elementsSelectable : edge.selectable"
:updatable="typeof edge.updatable === 'undefined' ? edgesUpdatable : edge.updatable" :updatable="typeof edge.updatable === 'undefined' ? edgesUpdatable : edge.updatable"