@inertiajs/core 3.0.0-beta.7 → 3.0.1

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
@@ -2526,10 +2526,9 @@ var Response = class _Response {
2526
2526
  ...pageResponse.onceProps || {}
2527
2527
  };
2528
2528
  }
2529
- pageResponse.flash = {
2530
- ...page.get().flash,
2531
- ...this.requestParams.isDeferredPropsRequest() ? {} : pageResponse.flash
2532
- };
2529
+ if (this.requestParams.isDeferredPropsRequest()) {
2530
+ pageResponse.flash = { ...page.get().flash };
2531
+ }
2533
2532
  const currentOriginalDeferred = page.get().initialDeferredProps;
2534
2533
  if (currentOriginalDeferred && Object.keys(currentOriginalDeferred).length > 0) {
2535
2534
  pageResponse.initialDeferredProps = currentOriginalDeferred;
@@ -3629,6 +3628,9 @@ var Renderer = {
3629
3628
  const targetElements = Array.from(document.head.childNodes).filter(
3630
3629
  (element) => this.isInertiaManagedElement(element)
3631
3630
  );
3631
+ if (sourceElements.some((element) => element instanceof HTMLTitleElement)) {
3632
+ document.head.querySelectorAll("title:not([data-inertia])").forEach((title) => title.remove());
3633
+ }
3632
3634
  targetElements.forEach((targetElement) => {
3633
3635
  const index = this.findMatchingElementIndex(targetElement, sourceElements);
3634
3636
  if (index === -1) {
@@ -3640,7 +3642,9 @@ var Renderer = {
3640
3642
  targetElement.replaceWith(sourceElement);
3641
3643
  }
3642
3644
  });
3643
- sourceElements.forEach((element) => document.head.appendChild(element));
3645
+ sourceElements.forEach((element) => {
3646
+ document.head.appendChild(element);
3647
+ });
3644
3648
  }, 1)
3645
3649
  };
3646
3650
  function createHeadManager(isServer3, titleCallback, onUpdate) {