Skip to content

Commit

Permalink
fix(runtime): clean up ancestor nodes on resolve (#6094)
Browse files Browse the repository at this point in the history
      * fix(runtime): clean up ancestor nodes on resolve

* prettier
  • Loading branch information
christian-bromann authored Jan 16, 2025
1 parent 6537869 commit 2503dc5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/runtime/update-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ import { renderVdom } from './vdom/vdom-render';

export const attachToAncestor = (hostRef: d.HostRef, ancestorComponent?: d.HostElement) => {
if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
const index = ancestorComponent['s-p'].push(
new Promise(
(r) =>
(hostRef.$onRenderResolve$ = () => {
ancestorComponent['s-p'].splice(index - 1, 1);
r();
}),
),
);
}
};

Expand Down

0 comments on commit 2503dc5

Please sign in to comment.