Skip to content

Commit 0ce89c3

Browse files
fix: only re-execute beforeLoad if previous run failed (#4433)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 2a9b443 commit 0ce89c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/router-core/src/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2182,7 +2182,7 @@ export class RouterCore<
21822182

21832183
// Wait for the beforeLoad to resolve before we continue
21842184
await existingMatch.beforeLoadPromise
2185-
executeBeforeLoad = this.getMatch(matchId)!.status !== 'success'
2185+
executeBeforeLoad = this.getMatch(matchId)!.status === 'error'
21862186
}
21872187
if (executeBeforeLoad) {
21882188
// If we are not in the middle of a load OR the previous load failed, start it

0 commit comments

Comments
 (0)