From f56eea127a116d4f14016f6b7a9c4a0b1c3dcb9a Mon Sep 17 00:00:00 2001 From: sergeyyarkov Date: Thu, 16 Jul 2020 19:08:44 +0300 Subject: [PATCH] scroll fixed --- gatsby-browser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gatsby-browser.js b/gatsby-browser.js index ec77758..df66f53 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -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) } \ No newline at end of file