feat: connect wallet favorites to backend
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useEffect, useLayoutEffect, useRef } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
/**
|
||||
@@ -23,6 +23,15 @@ export function ScrollToTop() {
|
||||
const prevPathname = useRef(pathname);
|
||||
|
||||
useEffect(() => {
|
||||
if (!("scrollRestoration" in window.history)) return;
|
||||
const previous = window.history.scrollRestoration;
|
||||
window.history.scrollRestoration = "manual";
|
||||
return () => {
|
||||
window.history.scrollRestoration = previous;
|
||||
};
|
||||
}, []);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const pathnameChanged = prevPathname.current !== pathname;
|
||||
prevPathname.current = pathname;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user