fix: fix erronous branchone status

This commit is contained in:
Ruben Fiszel
2024-09-02 14:03:44 +02:00
parent 9bbfb20ae3
commit c5feaefec7
5 changed files with 10 additions and 4 deletions
@@ -938,7 +938,6 @@
if (rightColumnSelect != 'node_definition') {
rightColumnSelect = 'node_status'
}
console.log('BAR', e.detail)
if (typeof e.detail == 'string') {
if (e.detail == 'Input') {
selectedNode = 'start'
@@ -48,7 +48,7 @@
}
}
}}
id={`flow-editor-virtual-${label}`}
id={`flow-editor-virtual-${encodeURIComponent(label)}`}
>
<div
style={borderColor ? `border-color: ${borderColor};` : ''}
@@ -328,6 +328,7 @@ export default function graphBuilder(
branchIndex: -1,
modules: module.value.default,
eventHandlers: eventHandlers,
branchOne: true,
...extra
},
position: { x: -1, y: -1 },
@@ -21,7 +21,7 @@
}
$: borderStatus = computeBorderStatus(
data.branchIndex,
data.branchIndex + 1,
'branchone',
data.flowModuleStates?.[data.id]
)
@@ -5,6 +5,7 @@
import type { GraphEventHandlers } from '../../graphBuilder'
import { getStateColor } from '../../util'
import type { GraphModuleState } from '../../model'
import { computeBorderStatus } from '../utils'
export let data: {
id: string
@@ -14,7 +15,12 @@
flowModuleStates: Record<string, GraphModuleState> | undefined
offset: number
label: string | undefined
branchOne: boolean
}
$: borderStatus = data.branchOne
? computeBorderStatus(0, 'branchone', data.flowModuleStates?.[data.id])
: undefined
</script>
<NodeWrapper offset={data.offset} let:darkMode enableSourceHandle enableTargetHandle>
@@ -25,7 +31,7 @@
selectable={true}
selected={false}
bgColor={getStateColor(undefined, darkMode)}
borderColor={getStateColor(data?.flowModuleStates?.[data?.id]?.type, darkMode)}
borderColor={getStateColor(borderStatus, darkMode)}
on:select={(e) => {
data?.eventHandlers?.select(e.detail)
}}