Skip to content

Commit

Permalink
Remove redirect logic from click handler in the Link components as we (
Browse files Browse the repository at this point in the history
…#1154)

already replace original href with redirect if it exists

Co-authored-by: Pavel Grinchenko <[email protected]>
  • Loading branch information
pavelgrinchenko and psdcoder authored Apr 15, 2020
1 parent c29a07c commit 8d9e2a3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/components/Link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback } from 'react'
import { URL } from 'iso-url'
import { useLocation } from '@reach/router'
import GatsbyLink from 'gatsby-link'
import { getRedirect, handleFrontRedirect } from '../../utils/shared/redirects'
import { getRedirect } from '../../utils/shared/redirects'
import { scrollIntoLayout, getScrollNode } from '../../utils/front/scroll'

export type ILinkProps = {
Expand Down Expand Up @@ -76,9 +76,6 @@ const Link: React.FC<ILinkProps> = ({ href, ...restProps }) => {
getScrollNode().scrollTop = 0
}
}

// Handle front redirects
handleFrontRedirect(location.host, location.pathname, e)
},
[restProps.onClick, currentLocation]
)
Expand Down

0 comments on commit 8d9e2a3

Please sign in to comment.