Browse Source

remove merge dup and register color theme in a right place

Yana Rose 4 years ago
parent
commit
c7ecd0f774
1 changed files with 2 additions and 6 deletions
  1. 2 6
      src/viewer/index.ts

+ 2 - 6
src/viewer/index.ts

@@ -162,12 +162,6 @@ export class Viewer {
         this.plugin.init();
         ReactDOM.render(React.createElement(Plugin, { plugin: this.plugin }), target);
 
-        const renderer = this.plugin.canvas3d!.props.renderer;
-        PluginCommands.Canvas3D.SetSettings(this.plugin, { settings: { renderer: { ...renderer, backgroundColor: o.backgroundColor } } });
-
-        this.plugin.representation.structure.themes.colorThemeRegistry.add(SuperposeColorThemeProvider);
-        // this.plugin.builders.structure.representation.registerPreset(RcsbSuperpositionRepresentationPreset);
-
         // TODO Check why this.plugin.canvas3d can be null
         // this.plugin.canvas3d can be null. The value is not assigned until React Plugin component is mounted
         // Next wait Promise guarantees that its value is defined
@@ -186,6 +180,8 @@ export class Viewer {
         wait.then(result=>{
             const renderer = this.plugin.canvas3d!.props.renderer;
             PluginCommands.Canvas3D.SetSettings(this.plugin, { settings: { renderer: { ...renderer, backgroundColor: o.backgroundColor } } });
+            this.plugin.representation.structure.themes.colorThemeRegistry.add(SuperposeColorThemeProvider);
+        // this.plugin.builders.structure.representation.registerPreset(RcsbSuperpositionRepresentationPreset);
         });
         if (o.showWelcomeToast) {
             PluginCommands.Toast.Show(this.plugin, {