From 6c8ae32ff92d1fd445c0c628fe3bd0b73aa3380d Mon Sep 17 00:00:00 2001 From: David Sehnal <david.sehnal@gmail.com> Date: Wed, 27 May 2020 19:46:03 +0200 Subject: [PATCH] mol-plugin: do not update focus theme if not set --- src/mol-plugin-state/builder/structure/representation-preset.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mol-plugin-state/builder/structure/representation-preset.ts b/src/mol-plugin-state/builder/structure/representation-preset.ts index b3919baf7..ca5044533 100644 --- a/src/mol-plugin-state/builder/structure/representation-preset.ts +++ b/src/mol-plugin-state/builder/structure/representation-preset.ts @@ -55,6 +55,8 @@ export namespace StructureRepresentationPresetProvider { } export function updateFocusRepr<T extends ColorTheme.BuiltIn>(plugin: PluginContext, structure: Structure, themeName: T | undefined, themeParams: ColorTheme.BuiltInParams<T> | undefined) { + if (!themeName && !themeParams) return; + return plugin.state.updateBehavior(StructureFocusRepresentation, p => { const c = createStructureColorThemeParams(plugin, structure, 'ball-and-stick', themeName, themeParams); p.surroundingsParams.colorTheme = c; -- GitLab