Skip to content

Commit

Permalink
Compare search and hash not just pathname
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Mar 2, 2018
1 parent 9b35ece commit f139c56
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/gatsby/cache-dir/production-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import history from "./history"
window.___history = history
import emitter from "./emitter"
window.___emitter = emitter
import shallowCompare from "shallow-compare"
import pages from "./pages.json"
import redirects from "./redirects.json"
import ComponentRenderer from "./component-renderer"
Expand Down Expand Up @@ -62,9 +61,14 @@ apiRunnerAsync(`onClientEntry`).then(() => {
if (redirect) {
pathname = redirect.toPath
}
const wl = window.location

// If we're already at this location, do nothing.
if (shallowCompare(window.location, location)) {
if (
wl.pathname === location.pathname &&
wl.search === location.search &&
wl.hash === location.hash
) {
return
}

Expand Down

0 comments on commit f139c56

Please sign in to comment.