Ver Fonte

fix issue with async handling in Safari

Alexander Rose há 5 anos atrás
pai
commit
dd9b25e0d6

+ 2 - 2
src/structure-viewer/helpers/model.ts

@@ -46,8 +46,8 @@ export class ModelLoader {
         await (this.plugin.customState as StructureViewerState).structureView.setAssembly(assemblyId)
     }
 
-    applyState(tree: StateBuilder) {
-        return PluginCommands.State.Update.dispatch(this.plugin, { state: this.plugin.state.dataState, tree })
+    async applyState(tree: StateBuilder) {
+        await PluginCommands.State.Update.dispatch(this.plugin, { state: this.plugin.state.dataState, tree })
     }
 
     constructor(private plugin: PluginContext) {

+ 2 - 2
src/structure-viewer/helpers/structure.ts

@@ -14,8 +14,8 @@ import { PluginStateObject as PSO } from 'molstar/lib/mol-plugin/state/objects';
 import { Structure, StructureElement } from 'molstar/lib/mol-model/structure';
 
 export class StructureView {
-    applyState(tree: StateBuilder) {
-        return PluginCommands.State.Update.dispatch(this.plugin, { state: this.plugin.state.dataState, tree });
+    async applyState(tree: StateBuilder) {
+        await PluginCommands.State.Update.dispatch(this.plugin, { state: this.plugin.state.dataState, tree });
     }
 
     get experimentalData () {