Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
feat(gatsby-browser): change exports to es6 modules
Browse files Browse the repository at this point in the history
  • Loading branch information
CanRau committed Oct 6, 2018
1 parent 0e8daf0 commit fb8acb2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ const scrollToMenu = () => {
* by https://github.com/gatsbyjs/gatsby/issues/7454#issuecomment-415786239
* as reach/router does not (yet) provide the used action for onRouteUpdate
*/
exports.shouldUpdateScroll = () => {
export const shouldUpdateScroll = () => {
if (window.__navigatingToLink === true) {
return [0, 0]
}
return true
}

exports.onRouteUpdate = () => {
export const onRouteUpdate = () => {
if (window.__navigatingToLink === true) {
window.setTimeout(scrollToMenu, 10)
}
window.__navigatingToLink = false
}

0 comments on commit fb8acb2

Please sign in to comment.