Skip to content

Commit

Permalink
Trigger response:error hook after loading.state:finished hook
Browse files Browse the repository at this point in the history
  • Loading branch information
YummYume committed Jun 16, 2024
1 parent ae2cf69 commit 1ae59fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/LiveComponent/assets/dist/live_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2059,8 +2059,8 @@ class Component {
if (!((_a = headers.get('Content-Type')) === null || _a === void 0 ? void 0 : _a.includes('application/vnd.live-component+html')) && !headers.get('X-Live-Redirect')) {
const controls = { displayError: true };
this.valueStore.pushPendingPropsBackToDirty();
this.hooks.triggerHook('response:error', backendResponse, controls);
this.hooks.triggerHook('loading.state:finished', this.element);
this.hooks.triggerHook('response:error', backendResponse, controls);
if (controls.displayError) {
this.renderError(html);
}
Expand Down
2 changes: 1 addition & 1 deletion src/LiveComponent/assets/src/Component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ export default class Component {
if (!headers.get('Content-Type')?.includes('application/vnd.live-component+html') && !headers.get('X-Live-Redirect')) {
const controls = { displayError: true };
this.valueStore.pushPendingPropsBackToDirty();
this.hooks.triggerHook('response:error', backendResponse, controls);
this.hooks.triggerHook('loading.state:finished', this.element);
this.hooks.triggerHook('response:error', backendResponse, controls);

if (controls.displayError) {
this.renderError(html);
Expand Down

0 comments on commit 1ae59fe

Please sign in to comment.