From 9738dfd7bca5ef0cd05f2cd14f94719d125d9669 Mon Sep 17 00:00:00 2001 From: Geoffrey Kwan Date: Tue, 14 May 2024 11:22:51 -0400 Subject: [PATCH] fix(Authoring): Delete first step in branch path loses criteria (#1797) --- src/assets/wise5/services/teacherProjectService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/assets/wise5/services/teacherProjectService.ts b/src/assets/wise5/services/teacherProjectService.ts index 88a25c7facf..d70c96a2a8d 100644 --- a/src/assets/wise5/services/teacherProjectService.ts +++ b/src/assets/wise5/services/teacherProjectService.ts @@ -1644,7 +1644,7 @@ export class TeacherProjectService extends ProjectService { } // remove the transition to the node we are removing - transitions.splice(t, 1); + const transitionRemoved = transitions.splice(t, 1)[0]; if (transitionsCopy != null) { let insertIndex = t; @@ -1685,6 +1685,9 @@ export class TeacherProjectService extends ProjectService { ) { this.addToTransition(node, this.getGroupStartId(toNodeId)); } else { + if (transitionRemoved.criteria != null) { + transitionCopy.criteria = transitionRemoved.criteria; + } transitions.splice(insertIndex, 0, transitionCopy); insertIndex++; }