Skip to content

Commit

Permalink
Make sure to update URL on fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Feb 7, 2020
1 parent d56c583 commit cebfcbc
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/next/next-server/lib/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,16 +400,14 @@ export default class Router implements BaseRouter {
return resolve(false)
}

if (emit) {
Router.events.emit('beforeHistoryChange', as)
this.changeState(method, url, addBasePath(as), options)

if (process.env.NODE_ENV !== 'production') {
const appComp: any = this.components['/_app'].Component
;(window as any).next.isPrerendered =
appComp.getInitialProps === appComp.origGetInitialProps &&
!(routeInfo.Component as any).getInitialProps
}
Router.events.emit('beforeHistoryChange', as)
this.changeState(method, url, addBasePath(as), options)

if (process.env.NODE_ENV !== 'production') {
const appComp: any = this.components['/_app'].Component
;(window as any).next.isPrerendered =
appComp.getInitialProps === appComp.origGetInitialProps &&
!(routeInfo.Component as any).getInitialProps
}

this.set(route, pathname, query, as, routeInfo)
Expand Down

0 comments on commit cebfcbc

Please sign in to comment.