소스 검색

fix issue with async handling in Safari

Alexander Rose 5 년 전
부모
커밋
dd9b25e0d6
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      src/structure-viewer/helpers/model.ts
  2. 2 2
      src/structure-viewer/helpers/structure.ts

+ 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 () {