Skip to content

Commit

Permalink
update check
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Nov 14, 2022
1 parent e39c58d commit 5926f4f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/next/shared/lib/router/router.ts
Expand Up @@ -1218,7 +1218,7 @@ export default class Router implements BaseRouter {

// if a route transition is already in progress before
// the query updating is triggered ignore query updating
if (isQueryUpdating && this.clc) {
if (isQueryUpdating && (this.clc || !isSsr)) {
return false
}

Expand Down Expand Up @@ -1424,10 +1424,6 @@ export default class Router implements BaseRouter {
(!isDynamicRoute(route) ||
!getRouteMatcher(getRouteRegex(route))(parsedAsPathname))

if (isMiddlewareRewrite) {
isQueryUpdating = false
}

// we don't attempt resolve asPath when we need to execute
// middleware as the resolving will occur server-side
const isMiddlewareMatch = await matchesMiddleware({
Expand Down Expand Up @@ -1577,7 +1573,8 @@ export default class Router implements BaseRouter {
isPreview: nextState.isPreview,
hasMiddleware: isMiddlewareMatch,
unstable_skipClientCache: options.unstable_skipClientCache,
isQueryUpdating: isQueryUpdating && !this.isFallback,
isQueryUpdating:
isQueryUpdating && !this.isFallback && !isMiddlewareRewrite,
})

if ('route' in routeInfo && isMiddlewareMatch) {
Expand Down

0 comments on commit 5926f4f

Please sign in to comment.