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
already replace original href with redirect if it exists
  • Loading branch information
psdcoder committed Apr 15, 2020
1 parent c29a07c commit a8230ac
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 a8230ac

Please sign in to comment.