mirror of
https://github.com/sergeyyarkov/devthread.ru.git
synced 2026-10-11 10:19:13 +03:00
scroll fixed
This commit is contained in:
parent
472b2acd75
commit
f56eea127a
@ -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)
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user