Browse Source

Current Interaction -> Focus, Fix StructureSelectionFromBundle

David Sehnal 5 years ago
parent
commit
7959344bca

+ 2 - 4
src/mol-plugin-state/transforms/model.ts

@@ -570,8 +570,7 @@ const StructureSelectionFromBundle = PluginStateTransform.BuiltIn({
 })({
     apply({ a, params, cache }) {
         if (params.bundle.hash !== a.data.hashCode) {
-            // Bundle not compatible with given structure, set to empty bundle
-            params.bundle = StructureElement.Bundle.Empty
+            return StateObject.Null;
         }
 
         (cache as { source: Structure }).source = a.data;
@@ -588,8 +587,7 @@ const StructureSelectionFromBundle = PluginStateTransform.BuiltIn({
         }
 
         if (newParams.bundle.hash !== a.data.hashCode) {
-            // Bundle not compatible with given structure, set to empty bundle
-            newParams.bundle = StructureElement.Bundle.Empty
+            return StateTransformer.UpdateResult.Null;
         }
 
         if ((cache as { source: Structure }).source === a.data) {

+ 1 - 1
src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts

@@ -78,7 +78,7 @@ export class StructureRepresentationInteractionBehavior extends PluginBehavior.W
 
         if (!refs['structure-interaction-group']) {
             refs['structure-interaction-group'] = builder.to(cell).group(StateTransforms.Misc.CreateGroup,
-                { label: 'Current Interaction' }, { tags: Tags.Group }).ref;
+                { label: 'Current Focus' }, { tags: Tags.Group }).ref;
         }
 
         // Selections