Skip to content

Commit ad50018

Browse files
committed
fix route unit tests
1 parent 29c557d commit ad50018

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/router-core/src/router.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,24 +2279,24 @@ export class RouterCore<
22792279
}
22802280

22812281
updateMatch: UpdateMatchFn = (id, updater) => {
2282-
const matchesKey = this.state.pendingMatches?.some((d) => d.id === id)
2283-
? 'pendingMatches'
2284-
: this.state.matches.some((d) => d.id === id)
2285-
? 'matches'
2286-
: this.state.cachedMatches.some((d) => d.id === id)
2287-
? 'cachedMatches'
2288-
: ''
2289-
2290-
if (matchesKey) {
2291-
this.startTransition(() => {
2282+
this.startTransition(() => {
2283+
const matchesKey = this.state.pendingMatches?.some((d) => d.id === id)
2284+
? 'pendingMatches'
2285+
: this.state.matches.some((d) => d.id === id)
2286+
? 'matches'
2287+
: this.state.cachedMatches.some((d) => d.id === id)
2288+
? 'cachedMatches'
2289+
: ''
2290+
2291+
if (matchesKey) {
22922292
this.__store.setState((s) => ({
22932293
...s,
22942294
[matchesKey]: s[matchesKey]?.map((d) =>
22952295
d.id === id ? updater(d) : d,
22962296
),
22972297
}))
2298-
})
2299-
}
2298+
}
2299+
})
23002300
}
23012301

23022302
getMatch: GetMatchFn = (matchId: string) => {

0 commit comments

Comments
 (0)