fix resolve missing node when target has both previous and next missing node
This commit is contained in:
@@ -463,13 +463,18 @@ export class Replayer {
|
|||||||
const { previousId, nextId } = targetMutation;
|
const { previousId, nextId } = targetMutation;
|
||||||
const previousInMap = previousId && map[previousId];
|
const previousInMap = previousId && map[previousId];
|
||||||
const nextInMap = nextId && map[nextId];
|
const nextInMap = nextId && map[nextId];
|
||||||
if (previousInMap || nextInMap) {
|
if (previousInMap) {
|
||||||
const { node, mutation } = (previousInMap || nextInMap) as missingNode;
|
const { node, mutation } = previousInMap as missingNode;
|
||||||
if (previousInMap) {
|
parent.insertBefore(node, target);
|
||||||
parent.insertBefore(node, target);
|
delete map[mutation.node.id];
|
||||||
} else {
|
delete this.missingNodeRetryMap[mutation.node.id];
|
||||||
parent.insertBefore(node, target.nextSibling);
|
if (mutation.previousId || mutation.nextId) {
|
||||||
|
this.resolveMissingNode(map, parent, node as Node, mutation);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (nextInMap) {
|
||||||
|
const { node, mutation } = nextInMap as missingNode;
|
||||||
|
parent.insertBefore(node, target.nextSibling);
|
||||||
delete map[mutation.node.id];
|
delete map[mutation.node.id];
|
||||||
delete this.missingNodeRetryMap[mutation.node.id];
|
delete this.missingNodeRetryMap[mutation.node.id];
|
||||||
if (mutation.previousId || mutation.nextId) {
|
if (mutation.previousId || mutation.nextId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user