Repair dumb logic bugs introduced during port to TypeScript

This commit is contained in:
Tony Garnock-Jones 2021-01-29 15:41:11 +01:00
parent b5a4a150ac
commit 65bae07fc1
1 changed files with 3 additions and 6 deletions

View File

@ -176,10 +176,8 @@ function spawnUIFragmentFactory<T>(thisFacet: Facet<T>) {
let insertionPoint = findInsertionPoint(anchorNode, orderBy, fragmentId);
while (true) {
let n = insertionPoint ? insertionPoint.previousSibling : anchorNode.lastChild;
if (n && hasSortKey(n, orderBy, fragmentId)) {
// auto-updates previousSibling/lastChild
n.parentNode?.removeChild(n);
}
if (!(n && hasSortKey(n, orderBy, fragmentId))) break;
n.parentNode?.removeChild(n); // auto-updates previousSibling/lastChild
}
});
}
@ -206,8 +204,7 @@ function spawnUIFragmentFactory<T>(thisFacet: Facet<T>) {
let insertionPoint = findInsertionPoint(anchorNode, orderBy, fragmentId);
while (true) {
let uiNode = insertionPoint ? insertionPoint.previousSibling : anchorNode.lastChild;
if (uiNode === null) break;
if (!hasSortKey(uiNode, orderBy, fragmentId)) break;
if (!(uiNode && hasSortKey(uiNode, orderBy, fragmentId))) break;
if (isQueryableNode(uiNode)) {
selectorMatch(uiNode, selector).forEach(
eventUpdater(cleanEventType(eventType), handlerClosure, install));