refactor: moved the nobeliefCyclerule into BeliefGlobals, and fixed function and filenaming

ref: N25B-433
This commit is contained in:
JGerla
2026-01-14 13:44:59 +01:00
parent 3d6e065dd5
commit 1f0237baac
4 changed files with 53 additions and 60 deletions

View File

@@ -12,7 +12,7 @@ import {allowOnlyConnectionsFromHandle, allowOnlyConnectionsFromType} from "../H
import useFlowStore from '../VisProgStores';
import { PlanReduce, type Plan } from '../components/Plan';
import PlanEditorDialog from '../components/PlanEditor';
import {BeliefGlobals} from "./BeliefGlobals.ts";
import {BeliefGlobalReduce} from "./BeliefGlobals.ts";
/**
* The default data structure for a Trigger node
@@ -92,7 +92,7 @@ export default function TriggerNode(props: NodeProps<TriggerNode>) {
export function TriggerReduce(node: Node, nodes: Node[]) {
const data = node.data as TriggerNodeData;
const conditionNode = data.condition ? nodes.find((n)=>n.id===data.condition) : undefined
const conditionData = conditionNode ? BeliefGlobals(conditionNode, nodes) : ""
const conditionData = conditionNode ? BeliefGlobalReduce(conditionNode, nodes) : ""
return {
id: node.id,
condition: conditionData, // Make sure we have a condition before reducing, or default to ""