Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSGJ authored Mar 16, 2023
1 parent 1a7e236 commit 9531b9e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ const NextTopLoader = (props: NextTopLoaderProps) => {
let currentUrl = window.location.href;
let newUrl = (event.currentTarget as HTMLAnchorElement).href;
let isExternalLink = (event.currentTarget as HTMLAnchorElement).target === "_blank";
if (isExternalLink) return null;
function isAnchorOfCurrentUrl(currentUrl: string, newUrl: string) {
const currentUrlObj = new URL(currentUrl);
const newUrlObj = new URL(newUrl);
Expand All @@ -123,7 +122,7 @@ const NextTopLoader = (props: NextTopLoaderProps) => {
return false;
}
const isAnchor = isAnchorOfCurrentUrl(currentUrl, newUrl);
if (newUrl === currentUrl || isAnchor) {
if (newUrl === currentUrl || isAnchor || isExternalLink) {
NProgress.start();
NProgress.done();
[].forEach.call(npgclass, function (el: Element) {
Expand Down

0 comments on commit 9531b9e

Please sign in to comment.