Add directive for unlimited
This commit is contained in:
parent
285a744cba
commit
5c4c73dbf9
1 changed files with 3 additions and 4 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue