Skip to content

Commit 4946d80

Browse files
committed
Review widget: fix error in node deletion handling
After node deletion, the review segment showed an error if a subarbor was under review. This is fixed now by checking if there is a subarbor under review in the first place, before attempting to refer to it. Second, the view isn't moved anymore after a node was deleted. As @acardona pointed out, this is rather distracting and one is usually well aware where one deletes a node. Plus, returning to the node under review can be achieved by W/E key presses or by clicking on the "Review" button. See catmaid/catmaid@2280
1 parent 1a605a1 commit 4946d80

File tree

1 file changed

+5
-3
lines changed
  • django/applications/catmaid/static/js/widgets

1 file changed

+5
-3
lines changed

django/applications/catmaid/static/js/widgets/review.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@
107107
this.handleDeletedSkeleton = function(nodeId, parentId, skeletonId) {
108108
if (skeletonId == this.currentSkeletonId) {
109109
CATMAID.info('Review widget updated due to skeleton change');
110-
this.startSkeletonToReview(skeletonId, undefined, true, () => {
111-
this.current_segment = this.skeleton_segments[this.current_segment.id];
112-
this.goToNodeIndexOfSegmentSequence(this.current_segment_index, true);
110+
this.startSkeletonToReview(skeletonId, this.currentSubarborNodeId, true, () => {
111+
if (this.current_segment) {
112+
// Reload data, in case the deleted node was part of this segment
113+
this.current_segment = this.skeleton_segments[this.current_segment.id];
114+
}
113115
});
114116
}
115117
};

0 commit comments

Comments
 (0)