deduplicate

pull/17021/head
Simon H 10 months ago committed by GitHub
parent 1740624fe2
commit d2ab978a7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -159,14 +159,7 @@ export class Boundary {
this.#hydrate_resolved_content();
}
} else {
var anchor = this.#anchor;
if (this.#pending) {
this.#pending_anchor = create_text();
this.#anchor.before(this.#pending_anchor);
anchor = this.#pending_anchor;
}
var anchor = this.#get_anchor();
try {
this.#main_effect = branch(() => children(anchor));
@ -211,14 +204,7 @@ export class Boundary {
this.#pending_effect = branch(() => pending(this.#anchor));
Batch.enqueue(() => {
var anchor = this.#anchor;
if (this.#pending) {
this.#pending_anchor = create_text();
this.#anchor.before(this.#pending_anchor);
anchor = this.#pending_anchor;
}
var anchor = this.#get_anchor();
this.#main_effect = this.#run(() => {
Batch.ensure();
@ -237,6 +223,19 @@ export class Boundary {
});
}
#get_anchor() {
var anchor = this.#anchor;
if (this.#pending) {
this.#pending_anchor = create_text();
this.#anchor.before(this.#pending_anchor);
anchor = this.#pending_anchor;
}
return anchor;
}
/**
* Returns `true` if the effect exists inside a boundary whose pending snippet is shown
* @returns {boolean}

Loading…
Cancel
Save