diff --git a/src/Components/Editor/Editor.tsx b/src/Components/Editor/Editor.tsx index 784cca4..3a728e3 100644 --- a/src/Components/Editor/Editor.tsx +++ b/src/Components/Editor/Editor.tsx @@ -18,12 +18,11 @@ interface IEditorProps { historyCurrentStep: number } -export const getCurrentHistory = (history: IHistoryState[], historyCurrentStep: number): IHistoryState[] => { - return history.slice( - Math.max(0, history.length - MAX_HISTORY), +export const getCurrentHistory = (history: IHistoryState[], historyCurrentStep: number): IHistoryState[] => + history.slice( + Math.max(0, history.length - MAX_HISTORY), // change this to 0 for unlimited (not recommanded because of overflow) historyCurrentStep + 1 ); -}; export const getCurrentHistoryState = (history: IHistoryState[], historyCurrentStep: number): IHistoryState => history[historyCurrentStep];