From 38e055b4a0f008e5ea88903ba8c2f1fa12a5fe8f Mon Sep 17 00:00:00 2001 From: maximiliankoch Date: Fri, 21 Oct 2022 13:48:37 +0200 Subject: [PATCH] #41: This fixes the on click label sorting. --- src/reorders/customLabelReorder.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/reorders/customLabelReorder.ts b/src/reorders/customLabelReorder.ts index 256e4d9e..89216fa3 100644 --- a/src/reorders/customLabelReorder.ts +++ b/src/reorders/customLabelReorder.ts @@ -71,13 +71,12 @@ export default (function customLabelReorder( ordered_names.push(newNetwork[other_axis + "_nodes"][inst_index].name); }); - const newAxisNodes = _.map( - newNetwork[other_axis + "_nodes"], - function (inst_node) { - inst_node.custom = - num_other_labels - ordered_names.indexOf(inst_node.name) - 1; - } - ); + const newAxisNodes: any[] = []; + _.map(newNetwork[other_axis + "_nodes"], function (inst_node) { + inst_node.custom = + num_other_labels - ordered_names.indexOf(inst_node.name) - 1; + newAxisNodes.push(inst_node); + }); dispatch( store.actions.mutateNetworkState({