From 1ae59feb2963429f96156c32236b7f29a6a626fd Mon Sep 17 00:00:00 2001 From: YummYume Date: Sun, 16 Jun 2024 10:50:09 +0200 Subject: [PATCH] Trigger response:error hook after loading.state:finished hook --- src/LiveComponent/assets/dist/live_controller.js | 2 +- src/LiveComponent/assets/src/Component/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LiveComponent/assets/dist/live_controller.js b/src/LiveComponent/assets/dist/live_controller.js index 669a26a5234..59c554a9df9 100644 --- a/src/LiveComponent/assets/dist/live_controller.js +++ b/src/LiveComponent/assets/dist/live_controller.js @@ -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); } diff --git a/src/LiveComponent/assets/src/Component/index.ts b/src/LiveComponent/assets/src/Component/index.ts index fdd2b4b0f11..96369b32871 100644 --- a/src/LiveComponent/assets/src/Component/index.ts +++ b/src/LiveComponent/assets/src/Component/index.ts @@ -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);