소스 검색

mol-state: sync root node transform version

David Sehnal 6 년 전
부모
커밋
4ad37d116b
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/mol-state/state.ts

+ 5 - 1
src/mol-state/state.ts

@@ -520,7 +520,10 @@ async function updateNode(ctx: UpdateContext, currentRef: Ref): Promise<UpdateNo
     const transform = current.transform;
 
     // special case for Root
-    if (current.transform.ref === Transform.RootRef) return { action: 'none' };
+    if (current.transform.ref === Transform.RootRef) {
+        current.version = transform.version;
+        return { action: 'none' };
+    }
 
     const parentCell = StateSelection.findAncestorOfType(tree, ctx.cells, currentRef, transform.transformer.definition.from);
     if (!parentCell) {
@@ -560,6 +563,7 @@ async function updateNode(ctx: UpdateContext, currentRef: Ref): Promise<UpdateNo
                 current.version = transform.version;
                 return { ref: currentRef, action: 'updated', obj: current.obj! };
             default:
+                current.version = transform.version;
                 return { action: 'none' };
         }
     }