Skip to content

Commit a24f974

Browse files
committed
StateView: do not manually ADD to StateView if item isNew
1 parent a57ce72 commit a24f974

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/encoder/StateView.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export class StateView {
9090
const op = changeTree.indexedOperations[index] ?? OPERATION.ADD;
9191
const tagAtIndex = metadata?.[index].tag;
9292
if (
93+
!changeTree.isNew && // new structures will be added as part of .encode() call, no need to force it to .encodeView()
9394
(
9495
isInvisible || // if "invisible", include all
9596
tagAtIndex === undefined || // "all change" with no tag
@@ -132,8 +133,8 @@ export class StateView {
132133
this.addParentOf(changeTree, tag);
133134
}
134135

135-
// parent is already available, no need to add it!
136-
if (!this.invisible.has(changeTree)) { return; }
136+
// // parent is already available, no need to add it!
137+
// if (!this.invisible.has(changeTree)) { return; }
137138
}
138139

139140
// add parent's tag properties

0 commit comments

Comments
 (0)