@inertiajs/core 2.1.5 → 2.1.7
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 +7 -2
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +7 -2
- package/dist/index.js.map +2 -2
- package/package.json +3 -3
- package/types/progress-component.d.ts +1 -1
- package/types/response.d.ts +1 -0
- package/types/url.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -778,12 +778,12 @@ var EventHandler = class {
|
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
780
|
onGlobalEvent(type, callback) {
|
|
781
|
-
const listener = (event) => {
|
|
781
|
+
const listener = ((event) => {
|
|
782
782
|
const response = callback(event);
|
|
783
783
|
if (event.cancelable && !event.defaultPrevented && response === false) {
|
|
784
784
|
event.preventDefault();
|
|
785
785
|
}
|
|
786
|
-
};
|
|
786
|
+
});
|
|
787
787
|
return this.registerListener(`inertia:${type}`, listener);
|
|
788
788
|
}
|
|
789
789
|
on(event, callback) {
|
|
@@ -1454,6 +1454,7 @@ var Response = class _Response {
|
|
|
1454
1454
|
this.requestParams = requestParams;
|
|
1455
1455
|
this.response = response;
|
|
1456
1456
|
this.originatingPage = originatingPage;
|
|
1457
|
+
this.wasPrefetched = false;
|
|
1457
1458
|
}
|
|
1458
1459
|
static create(params, response, originatingPage) {
|
|
1459
1460
|
return new _Response(params, response, originatingPage);
|
|
@@ -1468,6 +1469,7 @@ var Response = class _Response {
|
|
|
1468
1469
|
}
|
|
1469
1470
|
async process() {
|
|
1470
1471
|
if (this.requestParams.all().prefetch) {
|
|
1472
|
+
this.wasPrefetched = true;
|
|
1471
1473
|
this.requestParams.all().prefetch = false;
|
|
1472
1474
|
this.requestParams.all().onPrefetched(this.response, this.requestParams.all());
|
|
1473
1475
|
firePrefetchedEvent(this.response, this.requestParams.all());
|
|
@@ -1487,6 +1489,9 @@ var Response = class _Response {
|
|
|
1487
1489
|
return this.requestParams.all().onError(scopedErrors);
|
|
1488
1490
|
}
|
|
1489
1491
|
router.flushByCacheTags(this.requestParams.all().invalidateCacheTags || []);
|
|
1492
|
+
if (!this.wasPrefetched) {
|
|
1493
|
+
router.flush(page.get().url);
|
|
1494
|
+
}
|
|
1490
1495
|
fireSuccessEvent(page.get());
|
|
1491
1496
|
await this.requestParams.all().onSuccess(page.get());
|
|
1492
1497
|
history.preserveUrl = false;
|