Browse Source

hide Export control when no structure is loaded

Yana Rose 4 years ago
parent
commit
277caec0e0
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/viewer/ui/export.tsx

+ 7 - 0
src/viewer/ui/export.tsx

@@ -13,6 +13,13 @@ export class ExportControls extends CollapsableControls {
             brand: { accent:  'gray' as const, svg: ExportOutlinedSvg }
         };
     }
+
+    componentDidMount() {
+        this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, sel => {
+            this.setState({ isHidden: sel.structures.length === 0 });
+        });
+    }
+
     protected renderControls(): JSX.Element | null {
         return <div className={'msp-control-offset'} style={{ paddingTop: '1px' }}>
             <CoordinatesExportControls />