From 035cf54d2f6c06ff1a0a411ecab1911f5c3ae032 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Mon, 10 Jun 2024 17:33:36 -0300 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(headerComponent):=20incre?= =?UTF-8?q?ase=20route=20history=20slice=20size=20to=20100=20for=20better?= =?UTF-8?q?=20navigation=20tracking=20=F0=9F=90=9B=20(locationStore):=20up?= =?UTF-8?q?date=20route=20history=20limit=20to=20100=20to=20prevent=20exce?= =?UTF-8?q?ssive=20memory=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/components/headerComponent/index.tsx | 4 ++-- src/frontend/src/stores/locationStore.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/headerComponent/index.tsx b/src/frontend/src/components/headerComponent/index.tsx index 11a774b84..8a2b9a2cf 100644 --- a/src/frontend/src/components/headerComponent/index.tsx +++ b/src/frontend/src/components/headerComponent/index.tsx @@ -68,8 +68,8 @@ export default function Header(): JSX.Element { }; const visitedFlowPathBefore = () => { - const lastThreeVisitedPaths = routeHistory.slice(-3); - return lastThreeVisitedPaths.some((path) => path.includes("/flow/")); + const last100VisitedPaths = routeHistory.slice(-99); + return last100VisitedPaths.some((path) => path.includes("/flow/")); }; const showArrowReturnIcon = diff --git a/src/frontend/src/stores/locationStore.ts b/src/frontend/src/stores/locationStore.ts index 8ef3554e0..a57390343 100644 --- a/src/frontend/src/stores/locationStore.ts +++ b/src/frontend/src/stores/locationStore.ts @@ -7,7 +7,7 @@ export const useLocationStore = create((set, get) => ({ let routeHistoryArray = get().routeHistory; routeHistoryArray.push(location); - if (routeHistoryArray?.length > 9) { + if (routeHistoryArray?.length > 100) { routeHistoryArray.shift(); set({ routeHistory: routeHistoryArray,