From ea311d2ee44508434d2320df38629a2cd230fcdb Mon Sep 17 00:00:00 2001 From: Willem Poortman Date: Sun, 12 Feb 2023 10:41:31 +0100 Subject: [PATCH] Bugfix/loader missing effects (#75) * Bugfix on missing message effects property on failure hook --------- Co-authored-by: Willem --- src/view/frontend/templates/html/loader.phtml | 2 +- .../templates/page/js/magewire/plugin/loader.phtml | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/view/frontend/templates/html/loader.phtml b/src/view/frontend/templates/html/loader.phtml index 01aa657..49af5ba 100644 --- a/src/view/frontend/templates/html/loader.phtml +++ b/src/view/frontend/templates/html/loader.phtml @@ -63,11 +63,11 @@ $magewireScripts = $block->getViewModel(); x-cloak role="status" aria-live="polite" + x-bind:class="{'z-50 relative': active}" >
component.id !== item.component.id) - let emits = null + queue = queue.filter(item => component.id !== item.component.id); - if (message.response.effects.emits) { - emits = message.response.effects.emits || null - } - - if (emits) { - emits.forEach((emit) => { + if (message.response && message.response.effects) { + (message.response.effects.emits || []).forEach((emit) => { Magewire.components.componentsListeningForEvent(emit.event).forEach((component) => { queue.push({ component: component, emit: true }) })