Skip to content

Commit 1ae59fe

Browse files
committed
Trigger response:error hook after loading.state:finished hook
1 parent ae2cf69 commit 1ae59fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/LiveComponent/assets/dist/live_controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2059,8 +2059,8 @@ class Component {
20592059
if (!((_a = headers.get('Content-Type')) === null || _a === void 0 ? void 0 : _a.includes('application/vnd.live-component+html')) && !headers.get('X-Live-Redirect')) {
20602060
const controls = { displayError: true };
20612061
this.valueStore.pushPendingPropsBackToDirty();
2062-
this.hooks.triggerHook('response:error', backendResponse, controls);
20632062
this.hooks.triggerHook('loading.state:finished', this.element);
2063+
this.hooks.triggerHook('response:error', backendResponse, controls);
20642064
if (controls.displayError) {
20652065
this.renderError(html);
20662066
}

src/LiveComponent/assets/src/Component/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ export default class Component {
299299
if (!headers.get('Content-Type')?.includes('application/vnd.live-component+html') && !headers.get('X-Live-Redirect')) {
300300
const controls = { displayError: true };
301301
this.valueStore.pushPendingPropsBackToDirty();
302-
this.hooks.triggerHook('response:error', backendResponse, controls);
303302
this.hooks.triggerHook('loading.state:finished', this.element);
303+
this.hooks.triggerHook('response:error', backendResponse, controls);
304304

305305
if (controls.displayError) {
306306
this.renderError(html);

0 commit comments

Comments
 (0)