Move line to a better place

This commit is contained in:
Alfredo Sumaran 2017-05-31 21:18:11 -05:00
parent 7feda1a354
commit 24b456e6a3

View file

@ -52,10 +52,9 @@ export default class GroupsStore {
Object.keys(mappedGroups).map((key) => { Object.keys(mappedGroups).map((key) => {
const currentGroup = mappedGroups[key]; const currentGroup = mappedGroups[key];
// If the group is not at the root level, add it to its parent array of subGroups.
const findParentGroup = mappedGroups[currentGroup.parentId];
if (currentGroup.parentId) { if (currentGroup.parentId) {
// If the group is not at the root level, add it to its parent array of subGroups.
const findParentGroup = mappedGroups[currentGroup.parentId];
if (findParentGroup) { if (findParentGroup) {
mappedGroups[currentGroup.parentId].subGroups[currentGroup.id] = currentGroup; mappedGroups[currentGroup.parentId].subGroups[currentGroup.id] = currentGroup;
mappedGroups[currentGroup.parentId].isOpen = true; // Expand group if it has subgroups mappedGroups[currentGroup.parentId].isOpen = true; // Expand group if it has subgroups