From 5fed559334cf30ffcaf652a02f2348e2d5bbc60a Mon Sep 17 00:00:00 2001 From: David Sehnal <david.sehnal@gmail.com> Date: Wed, 7 Nov 2018 17:46:08 +0100 Subject: [PATCH] mol-plugin: tweaks --- src/mol-plugin/ui/plugin.tsx | 3 ++- src/mol-plugin/ui/state-tree.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mol-plugin/ui/plugin.tsx b/src/mol-plugin/ui/plugin.tsx index 598d5f26d..9e1f84a23 100644 --- a/src/mol-plugin/ui/plugin.tsx +++ b/src/mol-plugin/ui/plugin.tsx @@ -32,7 +32,8 @@ export class Plugin extends React.Component<{ plugin: PluginContext }, { }> { } export class _test_CurrentObject extends React.Component<{ plugin: PluginContext }, { }> { - componentWillMount() { + componentDidMount() { + // TODO: move to constructor? this.props.plugin.behaviors.state.data.currentObject.subscribe(() => this.forceUpdate()); } render() { diff --git a/src/mol-plugin/ui/state-tree.tsx b/src/mol-plugin/ui/state-tree.tsx index 7ad666396..f7dd468e2 100644 --- a/src/mol-plugin/ui/state-tree.tsx +++ b/src/mol-plugin/ui/state-tree.tsx @@ -11,7 +11,8 @@ import { StateObject } from 'mol-state' import { PluginCommands } from 'mol-plugin/command'; export class StateTree extends React.Component<{ plugin: PluginContext }, { }> { - componentWillMount() { + componentDidMount() { + // TODO: move to constructor? this.props.plugin.events.state.data.updated.subscribe(() => this.forceUpdate()); } render() { -- GitLab