Skip to content

Commit

Permalink
Fixing comparison of pathname change
Browse files Browse the repository at this point in the history
  • Loading branch information
march08 committed Jul 2, 2020
1 parent 7446b45 commit b02eb93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/after.js/src/After.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class Afterparty extends React.Component<AfterpartyProps, AfterpartyState> {

// Only for page changes, prevent scroll up for anchor links
if (
(prevState.currentLocation &&
prevState.currentLocation.pathname) !== location.pathname &&
prevState.currentLocation &&
prevState.currentLocation.pathname !== location.pathname &&
// Only Scroll if scrollToTop is not false
scrollToTop.current === true &&
instantMode === false
Expand Down

0 comments on commit b02eb93

Please sign in to comment.