@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.esm.js CHANGED
@@ -884,6 +884,9 @@ var setHashIfSameUrl = (originUrl, destinationUrl) => {
884
884
  var isSameUrlWithoutHash = (url1, url2) => {
885
885
  return urlWithoutHash(url1).href === urlWithoutHash(url2).href;
886
886
  };
887
+ var isSameUrlWithoutQueryOrHash = (url1, url2) => {
888
+ return url1.origin === url2.origin && url1.pathname === url2.pathname;
889
+ };
887
890
  function isUrlMethodPair(href) {
888
891
  return href !== null && typeof href === "object" && href !== void 0 && "url" in href && "method" in href;
889
892
  }
@@ -2426,7 +2429,10 @@ var Router = class {
2426
2429
  if (events.onBefore(visit) === false || !fireBeforeEvent(visit)) {
2427
2430
  return;
2428
2431
  }
2429
- if (!isSameUrlWithoutHash(visit.url, hrefToUrl(page.get().url))) {
2432
+ const currentPageUrl = hrefToUrl(page.get().url);
2433
+ const isPartialReload = visit.only.length > 0 || visit.except.length > 0 || visit.reset.length > 0;
2434
+ const isSamePage = isPartialReload ? isSameUrlWithoutQueryOrHash(visit.url, currentPageUrl) : isSameUrlWithoutHash(visit.url, currentPageUrl);
2435
+ if (!isSamePage) {
2430
2436
  this.asyncRequestStream.cancelInFlight({ prefetch: false });
2431
2437
  }
2432
2438
  if (!visit.async) {