Make sure plugin is set for cornerstone viewports before a layout change is triggered

This commit is contained in:
dannyrb 2019-06-17 14:45:53 -04:00
parent 6050721d33
commit 8b636b53be
2 changed files with 3 additions and 9 deletions

View File

@ -3,11 +3,7 @@ import OHIF from 'ohif-core';
import { connect } from 'react-redux';
import throttle from 'lodash.throttle';
const {
setViewportActive,
setViewportSpecificData,
clearViewportSpecificData
} = OHIF.redux.actions;
const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions;
const mapStateToProps = (state, ownProps) => {
let dataFromStore;
@ -58,6 +54,8 @@ const mapDispatchToProps = (dispatch, ownProps) => {
const enabledElement = event.detail.element;
dispatch(
setViewportSpecificData(viewportIndex, {
// TODO: Hack to make sure our plugin info is available from the outset
plugin: 'cornerstone',
dom: enabledElement
})
);

View File

@ -159,14 +159,10 @@ function _getVisibleToolbarButtons() {
definitions.forEach(definition => {
const context = definition.context || defaultContext;
console.log(context);
if (this.props.activeContexts.includes(context)) {
console.log('includes: ', definition.commandName);
toolbarButtonDefinitions.push(definition);
}
});
console.log(extension);
});
return toolbarButtonDefinitions;