diff --git a/src/components/MainCointainer.jsx b/src/components/MainCointainer.jsx index 31eb5fb..70c7172 100644 --- a/src/components/MainCointainer.jsx +++ b/src/components/MainCointainer.jsx @@ -156,6 +156,20 @@ function PersistentDrawerLeft({ loading, account, children, enableEthereum, loca const [logs, setLogs] = useState([]) const position = useWindowScrollPosition() + useEffect(() => { + try { + // trying to use new API - https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo + window.scroll({ + top: 0, + left: 0, + behavior: 'smooth', + }); + } catch (error) { + // just a fallback for older browsers + window.scrollTo(0, 0); + } + }, [pathname, search]) + useEffect(() => { const queryParams = queryString.parse(search) if (queryParams.logs) enableLogs()