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
|
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];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue