Skip to content

Commit ba1e890

Browse files
committed
Fix output arc type assignment in addArc
1 parent 7a653de commit ba1e890

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

libs/@hashintel/petrinaut/src/lsp/lib/create-sdcpn-language-service.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ describe("SDCPNLanguageServer completions", () => {
113113
inputArcs: [
114114
{ placeId: "place1", weight: 1, type: "standard" as const },
115115
],
116-
outputArcs: [
117-
{ placeId: "place2", weight: 1, type: "standard" as const },
118-
],
116+
outputArcs: [{ placeId: "place2", weight: 1 }],
119117
lambdaCode: "",
120118
transitionKernelCode: "",
121119
},

libs/@hashintel/petrinaut/src/state/mutation-provider.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,18 @@ export const MutationProvider: React.FC<MutationProviderProps> = ({
126126
guardedMutate((sdcpn) => {
127127
for (const transition of sdcpn.transitions) {
128128
if (transition.id === transitionId) {
129-
transition[
130-
arcDirection === "input" ? "inputArcs" : "outputArcs"
131-
].push({
132-
type: "standard",
133-
placeId,
134-
weight,
135-
});
129+
if (arcDirection === "input") {
130+
transition.inputArcs.push({
131+
type: "standard",
132+
placeId,
133+
weight,
134+
});
135+
} else {
136+
transition.outputArcs.push({
137+
placeId,
138+
weight,
139+
});
140+
}
136141
break;
137142
}
138143
}

0 commit comments

Comments
 (0)