소스 검색

keep old error states around

Sebastian Bittrich 3 년 전
부모
커밋
850754c46c
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      src/viewer/ui/validation.tsx

+ 5 - 2
src/viewer/ui/validation.tsx

@@ -42,10 +42,13 @@ export class ValidationReportControls extends CollapsableControls<{}, Validation
 
     componentDidMount() {
         this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, () => {
+            const { errorStates, description } = this.state;
+            const nextDescription = StructureHierarchyManager.getSelectedStructuresDescription(this.plugin);
             this.setState({
                 isHidden: !this.canEnable(),
-                errorStates: new Set<string>(),
-                description: StructureHierarchyManager.getSelectedStructuresDescription(this.plugin)
+                // if structure is unchanged then keep old error states
+                errorStates: nextDescription === description ? errorStates : new Set<string>(),
+                description: nextDescription
             });
         });
     }