Add directive for unlimited
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Siklos 2022-08-15 17:53:34 +02:00
parent 285a744cba
commit 5c4c73dbf9

View file

@ -18,12 +18,11 @@ interface IEditorProps {
historyCurrentStep: number historyCurrentStep: number
} }
export const getCurrentHistory = (history: IHistoryState[], historyCurrentStep: number): IHistoryState[] => { export const getCurrentHistory = (history: IHistoryState[], historyCurrentStep: number): IHistoryState[] =>
return history.slice( history.slice(
Math.max(0, history.length - MAX_HISTORY), Math.max(0, history.length - MAX_HISTORY), // change this to 0 for unlimited (not recommanded because of overflow)
historyCurrentStep + 1 historyCurrentStep + 1
); );
};
export const getCurrentHistoryState = (history: IHistoryState[], historyCurrentStep: number): IHistoryState => history[historyCurrentStep]; export const getCurrentHistoryState = (history: IHistoryState[], historyCurrentStep: number): IHistoryState => history[historyCurrentStep];