Explorar el Código

try to fix bouncing on first density focus

JonStargaryen hace 4 años
padre
commit
17bce48e17
Se han modificado 1 ficheros con 6 adiciones y 6 borrados
  1. 6 6
      src/viewer/helpers/preset.ts

+ 6 - 6
src/viewer/helpers/preset.ts

@@ -170,16 +170,16 @@ export const RcsbPreset = TrajectoryHierarchyPresetProvider({
                 timeoutMs: 60000
             })
 
+            plugin.behaviors.interaction.click.subscribe(async (e: InteractivityManager.ClickEvent) => {
+                if (e.current && e.current.loci && e.current.loci.kind !== 'empty-loci') {
+                    await PluginCommands.Toast.Hide(plugin, { key: 'toast-density' });
+                }
+            });
+
             ViewerState(plugin).collapsed.next({
                 ...ViewerState(plugin).collapsed.value,
                 volume: false
             })
-
-            plugin.behaviors.interaction.click.subscribe((e: InteractivityManager.ClickEvent) => {
-                if(e.current && e.current.loci && e.current.loci.kind !== 'empty-loci'){
-                    PluginCommands.Toast.Hide(plugin, { key: 'toast-density' });
-                }
-            });
         }
 
         return {