Skip to content

Commit

Permalink
Bugfix/loader missing effects (#75)
Browse files Browse the repository at this point in the history
* Bugfix on missing message effects property on failure hook

---------

Co-authored-by: Willem <git@wpoortman.nl>
  • Loading branch information
wpoortman and Willem authored Feb 12, 2023
1 parent 988cbec commit ea311d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/view/frontend/templates/html/loader.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ $magewireScripts = $block->getViewModel();
x-cloak
role="status"
aria-live="polite"
x-bind:class="{'z-50 relative': active}"
>
<div class="fixed
top-0 left-0 right-0 bottom-0
w-full h-screen
z-40
overflow-hidden
bg-white bg-opacity-90"
x-show="active"
Expand Down
11 changes: 3 additions & 8 deletions src/view/frontend/templates/page/js/magewire/plugin/loader.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,10 @@ use Magewirephp\Magewire\Model\Action\FireEvent;
start = null,

tryToStop = function(message, component, failed = false) {
queue = queue.filter(item => 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 })
})
Expand Down

0 comments on commit ea311d2

Please sign in to comment.