Skip to content

Commit 48cee38

Browse files
committed
edited comments for undo and redo
1 parent efa645c commit 48cee38

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/src/reducers/componentReducer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,8 @@ const reducer = (state: State, action: Action) => {
624624
if(state.components[focusIndex].past.length === 0) return {...state};
625625
//the children array of the focused component will equal the last element of the past array
626626
state.components[focusIndex].children = state.components[focusIndex].past[state.components[focusIndex].past.length - 1]
627-
//the last element of the future array gets pushed into the past
628-
//the last element of the future array gets popped out
627+
//the last element of the past array gets pushed into the future
628+
//the last element of the past array gets popped out
629629
state.components[focusIndex].future.push(state.components[focusIndex].past.pop())
630630

631631

@@ -636,6 +636,7 @@ const reducer = (state: State, action: Action) => {
636636
// state.components[focusIndex].children = state.past[state.past.length-1];
637637
// //the last element of past array gets pushed into future;
638638
// state.future.push(state.past.pop());
639+
639640
//generate code for the Code Preview
640641
state.components.forEach((el, i) => {
641642
el.code = generateCode(
@@ -668,6 +669,7 @@ const reducer = (state: State, action: Action) => {
668669
// state.components[focusIndex].children = state.future[state.future.length - 1];
669670
// //the last element of the future array gets pushed into the past array and the last element of the future array gets popped off
670671
// state.past.push(state.future.pop());
672+
671673
// //generate code for the Code Preview
672674
state.components.forEach((el, i) => {
673675
el.code = generateCode(

0 commit comments

Comments
 (0)