scroll fixed

This commit is contained in:
Sergey Yarkov 2020-07-16 19:08:44 +03:00
parent 472b2acd75
commit f56eea127a

View File

@ -26,9 +26,9 @@ export const shouldUpdateScroll = ({
routerProps: { location }
}) => {
const { pathname } = location
const scrollToTopRoutes = [`/`, `/about`, '/contacts', '/books', '/articles']
const stopScrollLinks = ['/articles/']
if (scrollToTopRoutes.indexOf(pathname) !== -1) window.scrollTo(0, 0)
if (stopScrollLinks.includes(pathname)) return false
return false
return window.scrollTo(0, 0)
}