fix: remove setting current index when max length is true
This commit is contained in:
parent
a80119c011
commit
614bef9008
1 changed files with 0 additions and 1 deletions
|
|
@ -31,7 +31,6 @@ export const HistoryProvider = ({ children }: Props) => {
|
|||
|
||||
if (newHistory.length > MAX_HISTORY) {
|
||||
newHistory.shift();
|
||||
setCurrentIndex((prev) => Math.max(prev - 1, 0));
|
||||
} else {
|
||||
setCurrentIndex(newHistory.length - 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue