mirror of
https://github.com/Qortal/qapp-core.git
synced 2025-06-14 17:41:20 +00:00
fix stringify
This commit is contained in:
parent
a9d824cb4d
commit
93313b50ca
@ -1,4 +1,5 @@
|
|||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import { useCacheStore } from "../state/cache";
|
||||||
|
|
||||||
export const useScrollTracker = (listName: string, hasList: boolean, disableScrollTracker?: boolean) => {
|
export const useScrollTracker = (listName: string, hasList: boolean, disableScrollTracker?: boolean) => {
|
||||||
const elementRef = useRef<HTMLDivElement | null>(null);
|
const elementRef = useRef<HTMLDivElement | null>(null);
|
||||||
@ -10,7 +11,8 @@ export const useScrollTracker = (listName: string, hasList: boolean, disableScro
|
|||||||
if (!listName || !hasList) return;
|
if (!listName || !hasList) return;
|
||||||
|
|
||||||
const SCROLL_KEY = `scroll-position-${listName}`;
|
const SCROLL_KEY = `scroll-position-${listName}`;
|
||||||
|
const isExpired = useCacheStore.getState().isListExpired(listName);
|
||||||
|
if(isExpired === true) return
|
||||||
// 🔹 Restore scroll when the component mounts
|
// 🔹 Restore scroll when the component mounts
|
||||||
const savedPosition = sessionStorage.getItem(SCROLL_KEY);
|
const savedPosition = sessionStorage.getItem(SCROLL_KEY);
|
||||||
if (savedPosition) {
|
if (savedPosition) {
|
||||||
|
@ -283,7 +283,7 @@ const addItems = useListStore((s) => s.addItems);
|
|||||||
delete copyParams.after
|
delete copyParams.after
|
||||||
delete copyParams.before
|
delete copyParams.before
|
||||||
delete copyParams.offset
|
delete copyParams.offset
|
||||||
setSearchParamsForList(listName, copyParams)
|
setSearchParamsForList(listName, JSON.stringify(copyParams))
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user