Skip to content

Commit b8af96d

Browse files
Update ActionContainer.tsx
1 parent 1fcb083 commit b8af96d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/app/containers/ActionContainer.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ function ActionContainer(props): JSX.Element {
5858
obj.stateSnapshot.children[0].state && // with a 'state'
5959
obj.stateSnapshot.children[0].name // and a 'name'
6060
) {
61-
const newObj: Record<string, unknown> = {
62-
// we create a new Record object (whose property keys are Keys and whose property values are Type. This utility can be used to map the properties of a type to another type) and populate it's properties with relevant values from our argument 'obj'.
61+
const newObj: Record<string, unknown> = { // we create a new Record object (whose property keys are Keys and whose property values are Type. This utility can be used to map the properties of a type to another type) and populate it's properties with relevant values from our argument 'obj'.
6362
index: obj.index,
6463
displayName: `${obj.name}.${obj.branch}`,
6564
state: obj.stateSnapshot.children[0].state,
@@ -73,8 +72,7 @@ function ActionContainer(props): JSX.Element {
7372
hierarchyArr.push(newObj); // we push our record object into 'hiearchyArr' defined on line 35
7473
}
7574

76-
if (obj.children) {
77-
// if argument has a 'children' array, we iterate through it and run 'displayArray' on each element
75+
if (obj.children) { // if argument has a 'children' array, we iterate through it and run 'displayArray' on each element
7876
obj.children.forEach((element): void => {
7977
displayArray(element);
8078
});
@@ -98,8 +96,7 @@ function ActionContainer(props): JSX.Element {
9896
currIndex++;
9997
if (currIndex > hierarchyArr.length - 1) return;
10098
dispatch(changeView(currIndex));
101-
} else if (e.key === 'Enter') {
102-
// enter key pressed
99+
} else if (e.key === 'Enter') { // enter key pressed
103100
e.stopPropagation(); // prevents further propagation of the current event in the capturing and bubbling phases
104101
e.preventDefault(); // needed or will trigger onClick right after
105102
dispatch(changeSlider(currIndex));
@@ -108,8 +105,6 @@ function ActionContainer(props): JSX.Element {
108105

109106
// Sort hierarchyArr by index property of each object. This will be useful when later when we build our components so that our components will be displayed in index/chronological order
110107
hierarchyArr.sort((a: Obj, b: Obj): number => a.index - b.index);
111-
// Sort hierarchyArr by index property of each object. This will be useful later when we render the components: components will be displayed in index/chronological order
112-
hierarchyArr.sort((a:Obj, b:Obj):number => a.index - b.index);
113108

114109
// we create a map of components that are constructed from "hierarchyArr's" elements/snapshots
115110
actionsArr = hierarchyArr.map(

0 commit comments

Comments
 (0)