@inertiajs/core 2.3.17 → 2.3.21

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
@@ -1059,7 +1059,7 @@ var CurrentPage = class {
1059
1059
  viewTransition
1060
1060
  }) {
1061
1061
  const doSwap = () => this.swapComponent({ component, page: page2, preserveState });
1062
- if (!viewTransition || !document?.startViewTransition) {
1062
+ if (!viewTransition || !document?.startViewTransition || document.visibilityState === "hidden") {
1063
1063
  return doSwap();
1064
1064
  }
1065
1065
  const viewTransitionCallback = typeof viewTransition === "boolean" ? () => null : viewTransition;
@@ -1914,7 +1914,6 @@ var Response = class _Response {
1914
1914
  }
1915
1915
  await history.processQueue();
1916
1916
  history.preserveUrl = this.requestParams.all().preserveUrl;
1917
- const previousFlash = page.get().flash;
1918
1917
  await this.setPage();
1919
1918
  const errors = page.get().props.errors || {};
1920
1919
  if (Object.keys(errors).length > 0) {
@@ -1927,7 +1926,7 @@ var Response = class _Response {
1927
1926
  router.flush(page.get().url);
1928
1927
  }
1929
1928
  const { flash } = page.get();
1930
- if (Object.keys(flash).length > 0 && (!this.requestParams.isPartial() || !isEqual2(flash, previousFlash))) {
1929
+ if (Object.keys(flash).length > 0 && !this.requestParams.isDeferredPropsRequest()) {
1931
1930
  fireFlashEvent(flash);
1932
1931
  this.requestParams.all().onFlash(flash);
1933
1932
  }
@@ -2123,10 +2122,9 @@ var Response = class _Response {
2123
2122
  ...pageResponse.onceProps || {}
2124
2123
  };
2125
2124
  }
2126
- pageResponse.flash = {
2127
- ...page.get().flash,
2128
- ...this.requestParams.isDeferredPropsRequest() ? {} : pageResponse.flash
2129
- };
2125
+ if (this.requestParams.isDeferredPropsRequest()) {
2126
+ pageResponse.flash = { ...page.get().flash };
2127
+ }
2130
2128
  const currentOriginalDeferred = page.get().initialDeferredProps;
2131
2129
  if (currentOriginalDeferred && Object.keys(currentOriginalDeferred).length > 0) {
2132
2130
  pageResponse.initialDeferredProps = currentOriginalDeferred;
@@ -2316,7 +2314,7 @@ var RequestStream = class {
2316
2314
  }
2317
2315
  send(request) {
2318
2316
  this.requests.push(request);
2319
- request.send().then(() => {
2317
+ request.send().finally(() => {
2320
2318
  this.requests = this.requests.filter((r) => r !== request);
2321
2319
  });
2322
2320
  }