@inertiajs/core 2.3.11 → 2.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -942,6 +942,9 @@ var setHashIfSameUrl = (originUrl, destinationUrl) => {
942
942
  var isSameUrlWithoutHash = (url1, url2) => {
943
943
  return urlWithoutHash(url1).href === urlWithoutHash(url2).href;
944
944
  };
945
+ var isSameUrlWithoutQueryOrHash = (url1, url2) => {
946
+ return url1.origin === url2.origin && url1.pathname === url2.pathname;
947
+ };
945
948
  function isUrlMethodPair(href) {
946
949
  return href !== null && typeof href === "object" && href !== void 0 && "url" in href && "method" in href;
947
950
  }
@@ -2484,7 +2487,10 @@ var Router = class {
2484
2487
  if (events.onBefore(visit) === false || !fireBeforeEvent(visit)) {
2485
2488
  return;
2486
2489
  }
2487
- if (!isSameUrlWithoutHash(visit.url, hrefToUrl(page.get().url))) {
2490
+ const currentPageUrl = hrefToUrl(page.get().url);
2491
+ const isPartialReload = visit.only.length > 0 || visit.except.length > 0 || visit.reset.length > 0;
2492
+ const isSamePage = isPartialReload ? isSameUrlWithoutQueryOrHash(visit.url, currentPageUrl) : isSameUrlWithoutHash(visit.url, currentPageUrl);
2493
+ if (!isSamePage) {
2488
2494
  this.asyncRequestStream.cancelInFlight({ prefetch: false });
2489
2495
  }
2490
2496
  if (!visit.async) {