From a8230ac5080b7b9846777f958115ed73d3079394 Mon Sep 17 00:00:00 2001 From: Pavel Grinchenko Date: Wed, 15 Apr 2020 19:54:57 +0300 Subject: [PATCH] Remove redirect logic from click handler in the Link components as we already replace original href with redirect if it exists --- src/components/Link/index.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/Link/index.tsx b/src/components/Link/index.tsx index 378ddca47a..cdac8f7156 100644 --- a/src/components/Link/index.tsx +++ b/src/components/Link/index.tsx @@ -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 = { @@ -76,9 +76,6 @@ const Link: React.FC = ({ href, ...restProps }) => { getScrollNode().scrollTop = 0 } } - - // Handle front redirects - handleFrontRedirect(location.host, location.pathname, e) }, [restProps.onClick, currentLocation] )