fix stringify

This commit is contained in:
PhilReact 2025-06-08 18:34:21 +03:00
parent a9d824cb4d
commit 93313b50ca
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import { useEffect, useRef, useState } from "react";
import { useCacheStore } from "../state/cache";
export const useScrollTracker = (listName: string, hasList: boolean, disableScrollTracker?: boolean) => {
const elementRef = useRef<HTMLDivElement | null>(null);
@ -10,7 +11,8 @@ export const useScrollTracker = (listName: string, hasList: boolean, disableScro
if (!listName || !hasList) return;
const SCROLL_KEY = `scroll-position-${listName}`;
const isExpired = useCacheStore.getState().isListExpired(listName);
if(isExpired === true) return
// 🔹 Restore scroll when the component mounts
const savedPosition = sessionStorage.getItem(SCROLL_KEY);
if (savedPosition) {

View File

@ -283,7 +283,7 @@ const addItems = useListStore((s) => s.addItems);
delete copyParams.after
delete copyParams.before
delete copyParams.offset
setSearchParamsForList(listName, copyParams)
setSearchParamsForList(listName, JSON.stringify(copyParams))
setIsLoading(false)
return
}