Ver Fonte

PurePluginUIComponent fix

David Sehnal há 5 anos atrás
pai
commit
4c1c484af9

+ 1 - 1
src/mol-plugin-state/manager/structure/component.ts

@@ -313,7 +313,7 @@ namespace StructureComponentManager {
     export function getAddParams(plugin: PluginContext) {
         return {
             selection: SelectionParam,
-            representation: getRepresentationTypesSelect(plugin, plugin.managers.structure.component.pivotStructure, [['none', '< None >']]),
+            representation: getRepresentationTypesSelect(plugin, plugin.managers.structure.component.pivotStructure, [['none', '< Create Later >']]),
             label: PD.Text('')
         };
     }

+ 4 - 3
src/mol-plugin-ui/base.tsx

@@ -19,14 +19,14 @@ export abstract class PluginUIComponent<P = {}, S = {}, SS = {}> extends React.C
     private subs: Subscription[] | undefined = void 0;
 
     protected subscribe<T>(obs: Observable<T>, action: (v: T) => void) {
-        if (typeof this.subs === 'undefined') this.subs = []
+        if (typeof this.subs === 'undefined') this.subs = [];
         this.subs.push(obs.subscribe(action));
     }
 
     componentWillUnmount() {
         if (!this.subs) return;
         for (const s of this.subs) s.unsubscribe();
-        this.subs = [];
+        this.subs = void 0;
     }
 
     protected init?(): void;
@@ -45,13 +45,14 @@ export abstract class PurePluginUIComponent<P = {}, S = {}, SS = {}> extends Rea
     private subs: Subscription[] | undefined = void 0;
 
     protected subscribe<T>(obs: Observable<T>, action: (v: T) => void) {
-        if (typeof this.subs === 'undefined') this.subs = []
+        if (typeof this.subs === 'undefined') this.subs = [];
         this.subs.push(obs.subscribe(action));
     }
 
     componentWillUnmount() {
         if (!this.subs) return;
         for (const s of this.subs) s.unsubscribe();
+        this.subs = void 0;
     }
 
     protected init?(): void;