Skip to content

Commit b080bfe

Browse files
committed
Move redirect short circuit upwards
1 parent e7b5435 commit b080bfe

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/router/router.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3395,6 +3395,11 @@ function getMatchesToLoad(
33953395
return;
33963396
}
33973397

3398+
// Don't revalidate an actively redirecting fetcher
3399+
if (fetchRedirectIds.has(key)) {
3400+
return;
3401+
}
3402+
33983403
let fetcherMatches = matchRoutes(routesToUse, f.path, basename);
33993404

34003405
// If the fetcher path no longer matches, push it in with null matches so
@@ -3418,10 +3423,7 @@ function getMatchesToLoad(
34183423
let fetcherMatch = getTargetMatch(fetcherMatches, f.path);
34193424

34203425
let shouldRevalidate = false;
3421-
if (fetchRedirectIds.has(key)) {
3422-
// Never trigger a revalidation of an actively redirecting fetcher
3423-
shouldRevalidate = false;
3424-
} else if (cancelledFetcherLoads.includes(key)) {
3426+
if (cancelledFetcherLoads.includes(key)) {
34253427
// Always revalidate if the fetcher was cancelled
34263428
shouldRevalidate = true;
34273429
} else if (

0 commit comments

Comments
 (0)