From 614bef90082d3f1e9385d8fe8aa46cde289550e2 Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Sat, 8 Feb 2025 13:35:46 +0000 Subject: [PATCH] fix: remove setting current index when max length is true --- src/context/History.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/context/History.tsx b/src/context/History.tsx index 643fadf..f9c786e 100644 --- a/src/context/History.tsx +++ b/src/context/History.tsx @@ -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); }