mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 23:09:34 +00:00
Refac take searchParams from router in Base.tsx
This commit is contained in:
@@ -36,6 +36,7 @@ export type OutletContextType = {
|
||||
};
|
||||
|
||||
const Base = () => {
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const { setAuth } = useAuthStore();
|
||||
const { setUserConfig } = useUserConfigStore();
|
||||
const { setUserAccount } = useUserAccountStore();
|
||||
@@ -45,12 +46,9 @@ const Base = () => {
|
||||
|
||||
const location = useLocation();
|
||||
|
||||
const searchParams = new URLSearchParams(location.search);
|
||||
|
||||
const currentPageFromUrl = Number(searchParams.get('page'));
|
||||
|
||||
const [currentPage, setCurrentPage] = useState(currentPageFromUrl);
|
||||
const [, setSearchParams] = useSearchParams();
|
||||
|
||||
useEffect(() => {
|
||||
setAuth(auth);
|
||||
|
||||
Reference in New Issue
Block a user