Skip to content

Commit

Permalink
1.8.0 release bugfix where emitted requests doesnt show the loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem committed Jan 31, 2023
1 parent 811b7d8 commit 988cbec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "magewirephp/magewire",
"description": "A framework that makes building dynamic interfaces simple, without leaving the comfort of Magento 2",
"version": "1.8.0",
"version": "1.8.1",
"type": "magento2-module",
"require": {
"magento/framework": "*",
Expand Down
2 changes: 1 addition & 1 deletion docs/Features.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ class Explanation extends \Magewirephp\Magewire\Component
```magewire:loader:start```
> Dispatched as soon as the first ```$loader``` driven component is active.
```magewire:loader:restart```
```magewire:loader:tick```
> Dispatched when another component has ```$loader``` settings.
```magewire:loader:fail```
Expand Down
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 @@ -27,7 +27,7 @@ $magewireScripts = $block->getViewModel();
notifications.push(Object.assign($event.detail, { active: true, show: true, failed: false }))
current = $event.detail.title ? notifications.length - 1 : current
"
x-on:magewire:loader:restart.window="
x-on:magewire:loader:tick.window="
if (notifications[current] !== undefined) {
notifications[current].active = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ use Magewirephp\Magewire\Model\Action\FireEvent;
queue = queue.filter(item => component.id !== item.component.id)
let emits = null

if (message.response && message.response.effects) {
let emits = message.response.effects.emits || null
if (message.response.effects.emits) {
emits = message.response.effects.emits || null
}

if (emits) {
Expand Down Expand Up @@ -118,7 +118,7 @@ use Magewirephp\Magewire\Model\Action\FireEvent;
queue.push({ loader: loader, component: component })
}

Magewire.dispatchEvent(`loader:${ first ? 'start' : 'restart' }`, {
Magewire.dispatchEvent(`loader:${ first ? 'start' : 'tick' }`, {
detail: Object.assign(loader, { component: component, start: start })
})
}
Expand Down

0 comments on commit 988cbec

Please sign in to comment.