refactor(edges): Remove get type call for names

This commit is contained in:
Braks
2022-04-29 12:24:12 +02:00
parent f9671b1ec4
commit 4cb4d9c0f4

View File

@@ -24,18 +24,15 @@ const {
} = $(useVueFlow())
const sourceNode = $(
controlledComputed(
() => connectionNodeId,
() => {
if (connectionNodeId) return getNode(connectionNodeId)
return false
},
),
controlledComputed($$(connectionNodeId), () => {
if (connectionNodeId) return getNode(connectionNodeId)
return false
}),
)
const connectionLineVisible = $(
controlledComputed(
() => connectionNodeId,
$$(connectionNodeId),
() =>
!!(
sourceNode &&
@@ -101,7 +98,7 @@ export default {
:id="edge.id"
:key="edge.id"
:edge="edge"
:name="getType(edge) ? edge.type ?? 'default' : 'default'"
:name="edge.type || 'default'"
:type="getType(edge)"
:selectable="typeof edge.selectable === 'undefined' ? elementsSelectable : edge.selectable"
:updatable="typeof edge.updatable === 'undefined' ? edgesUpdatable : edge.updatable"