Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed May 4, 2024
1 parent c9375d0 commit da634be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ export async function destroyElement(
if (component.ctx) {
const destructors: Array<Promise<void>> = [];
runDestructors(component.ctx, destructors);
await Promise.all(destructors);
if (destructors.length) {
await Promise.all(destructors);
}
}
try {
destroyNodes(component[$nodes]);
Expand Down

0 comments on commit da634be

Please sign in to comment.