Browse Source

avoid calculating actionItems for isDisabled check

Alexander Rose 3 years ago
parent
commit
97210ee67a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/mol-plugin-ui/structure/focus.tsx

+ 2 - 2
src/mol-plugin-ui/structure/focus.tsx

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ * Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
@@ -118,7 +118,7 @@ export class StructureFocusControls extends PluginUIComponent<{}, StructureFocus
     }
 
     get isDisabled() {
-        return this.state.isBusy || this.actionItems.length === 0;
+        return this.state.isBusy || this.plugin.managers.structure.hierarchy.selection.structures.length === 0;
     }
 
     getSelectionItems = memoizeLatest((structures: ReadonlyArray<StructureRef>) => {