diff --git a/src/mol-state/object.ts b/src/mol-state/object.ts index e8bdf73751d8d4b7fe63d5cffb7c6a834ba4204a..857d3249f5ea0cda44ad9f39f4d1cbf63e014d53 100644 --- a/src/mol-state/object.ts +++ b/src/mol-state/object.ts @@ -59,7 +59,6 @@ interface StateObjectCell<T = StateObject> { // Which object was used as a parent to create data in this cell sourceRef: Transform.Ref | undefined, - version: string status: StateObjectCell.Status, params: { diff --git a/src/mol-state/state.ts b/src/mol-state/state.ts index 42030da32278c8e08da5aefae600c17bf1d455ea..766daa3fb470882e8c853923eb25567fa2f9ce6f 100644 --- a/src/mol-state/state.ts +++ b/src/mol-state/state.ts @@ -8,7 +8,6 @@ import { StateObject, StateObjectCell } from './object'; import { StateTree } from './tree'; import { Transform } from './transform'; import { Transformer } from './transformer'; -import { UUID } from 'mol-util'; import { RuntimeContext, Task } from 'mol-task'; import { StateSelection } from './state/selection'; import { RxEventHelper } from 'mol-util/rx-event-helper'; @@ -184,7 +183,6 @@ class State { sourceRef: void 0, obj: rootObject, status: 'ok', - version: root.version, errorText: void 0, params: { definition: {}, @@ -350,7 +348,7 @@ function findUpdateRoots(cells: Map<Transform.Ref, StateObjectCell>, tree: State function findUpdateRootsVisitor(n: Transform, _: any, s: { roots: Ref[], cells: Map<Ref, StateObjectCell> }) { const cell = s.cells.get(n.ref); - if (!cell || cell.version !== n.version || cell.status === 'error') { + if (!cell || cell.transform.version !== n.version || cell.status === 'error') { s.roots.push(n.ref); return false; } @@ -406,7 +404,6 @@ function initCellsVisitor(transform: Transform, _: any, { ctx, added }: InitCell transform, sourceRef: void 0, status: 'pending', - version: UUID.create22(), errorText: void 0, params: void 0 }; @@ -556,7 +553,6 @@ async function updateNode(ctx: UpdateContext, currentRef: Ref): Promise<UpdateNo // special case for Root if (current.transform.ref === Transform.RootRef) { - current.version = transform.version; return { action: 'none' }; } @@ -574,7 +570,6 @@ async function updateNode(ctx: UpdateContext, currentRef: Ref): Promise<UpdateNo current.params = params; const obj = await createObject(ctx, currentRef, transform.transformer, parent, params.values); current.obj = obj; - current.version = transform.version; return { ref: currentRef, action: 'created', obj }; } else { @@ -591,14 +586,11 @@ async function updateNode(ctx: UpdateContext, currentRef: Ref): Promise<UpdateNo const oldObj = current.obj; const newObj = await createObject(ctx, currentRef, transform.transformer, parent, newParams); current.obj = newObj; - current.version = transform.version; return { ref: currentRef, action: 'replaced', oldObj, obj: newObj }; } case Transformer.UpdateResult.Updated: - current.version = transform.version; return { ref: currentRef, action: 'updated', obj: current.obj! }; default: - current.version = transform.version; return { action: 'none' }; } } diff --git a/src/mol-state/state/selection.ts b/src/mol-state/state/selection.ts index 828f7c9cf85a0926dae10d13bc6c675094939b64..d9aec37f87f11cff889c322832dd020e0c3b16dc 100644 --- a/src/mol-state/state/selection.ts +++ b/src/mol-state/state/selection.ts @@ -29,7 +29,7 @@ namespace StateSelection { } function isObj(arg: any): arg is StateObjectCell { - return (arg as StateObjectCell).version !== void 0 && (arg as StateObjectCell).transform !== void 0; + return (arg as StateObjectCell).transform !== void 0 && (arg as StateObjectCell).status !== void 0; } function isBuilder(arg: any): arg is Builder {