Skip to content

Commit

Permalink
fix: check component is connected before downloading or activating
Browse files Browse the repository at this point in the history
  • Loading branch information
Accudio committed Dec 27, 2024
1 parent ad1e5de commit d655c00
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dist/async-alpine.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ function async_alpine_default(Alpine) {
el,
id: el.id || index()
});
if (!el.isConnected) return;
await download(name);
if (!el.isConnected) return;
activate(el);
el._x_async = "loaded";
})();
Expand Down
2 changes: 2 additions & 0 deletions dist/async-alpine.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ function async_alpine_default(Alpine) {
el,
id: el.id || index()
});
if (!el.isConnected) return;
await download(name);
if (!el.isConnected) return;
activate(el);
el._x_async = "loaded";
})();
Expand Down
2 changes: 1 addition & 1 deletion dist/async-alpine.script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/async-alpine.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export default function (Alpine) {
el,
id: el.id || index(),
})
if (!el.isConnected) return
await download(name)
if (!el.isConnected) return
activate(el)
el._x_async = 'loaded'
})()
Expand Down

0 comments on commit d655c00

Please sign in to comment.