fix: IDC-2288: Update toolbar tabs after derived displayset loaded (#2307)
* Update toolbar tabs after derived displayset loaded * trigger CI Co-authored-by: Davide Punzo <punzodavide@hotmail.it>
This commit is contained in:
1 parent
a6a231c81e
commit
6e723ebced
3 files changed
+40
-2
No files matched your search
@@ -59,6 +59,9 @@ class ToolbarRow extends Component {
|
||||
this.seriesPerStudyCount = [];
|
||||
|
||||
this._handleBuiltIn = _handleBuiltIn.bind(this);
|
||||
this._onDerivedDisplaySetsLoadedAndCached = this._onDerivedDisplaySetsLoadedAndCached.bind(
|
||||
this
|
||||
);
|
||||
|
||||
this.updateButtonGroups();
|
||||
}
|
||||
@@ -109,6 +112,32 @@ class ToolbarRow extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
/*
|
||||
* TODO: Improve the way we notify parts of the app
|
||||
* that depends on derived display sets to be loaded.
|
||||
* (Implement pubsub for better tracking of derived display sets)
|
||||
*/
|
||||
document.addEventListener(
|
||||
'deriveddisplaysetsloadedandcached',
|
||||
this._onDerivedDisplaySetsLoadedAndCached
|
||||
);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener(
|
||||
'deriveddisplaysetsloadedandcached',
|
||||
this._onDerivedDisplaySetsLoadedAndCached
|
||||
);
|
||||
}
|
||||
|
||||
_onDerivedDisplaySetsLoadedAndCached() {
|
||||
this.updateButtonGroups();
|
||||
this.setState({
|
||||
toolbarButtons: _getVisibleToolbarButtons.call(this),
|
||||
});
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
const activeContextsChanged =
|
||||
prevProps.activeContexts !== this.props.activeContexts;
|
||||
|
||||
@@ -271,6 +271,7 @@ class Viewer extends Component {
|
||||
activeViewport={
|
||||
this.props.viewports[this.props.activeViewportIndex]
|
||||
}
|
||||
isDerivedDisplaySetsLoaded={this.props.isDerivedDisplaySetsLoaded}
|
||||
isLeftSidePanelOpen={this.state.isLeftSidePanelOpen}
|
||||
isRightSidePanelOpen={this.state.isRightSidePanelOpen}
|
||||
selectedLeftSidePanel={
|
||||
|
||||
Reference in new issue
Block a user