♻️ (headerComponent): increase route history slice size to 100 for better navigation tracking
🐛 (locationStore): update route history limit to 100 to prevent excessive memory usage
This commit is contained in:
parent
17d3d177c1
commit
035cf54d2f
2 changed files with 3 additions and 3 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export const useLocationStore = create<LocationStoreType>((set, get) => ({
|
|||
let routeHistoryArray = get().routeHistory;
|
||||
routeHistoryArray.push(location);
|
||||
|
||||
if (routeHistoryArray?.length > 9) {
|
||||
if (routeHistoryArray?.length > 100) {
|
||||
routeHistoryArray.shift();
|
||||
set({
|
||||
routeHistory: routeHistoryArray,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue