Skip to content

Commit b87ca04

Browse files
committed
Fixed redo bug
1 parent f6b3394 commit b87ca04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/reducers/mainReducers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const undo = (state: ApplicationStateInt) => {
192192

193193
export const redo = (state: ApplicationStateInt) => {
194194
//if the future history array is empty, return the current state
195-
if (!state.future) return { ...state };
195+
if (!state.future || !state.future.length) return { ...state };
196196
const stateCopy = cloneDeep(state);
197197
const futureCopy = cloneDeep(state.future);
198198
//grab the first element of the future history array and assign it to the new state

0 commit comments

Comments
 (0)