Remove code that depends on global "buttons" in Vtk Viewport
This commit is contained in:
parent
ba92111484
commit
1367f96dcd
@ -1,15 +1,10 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import { View2D } from 'react-vtkjs-viewport';
|
|
||||||
import OHIF from 'ohif-core';
|
import OHIF from 'ohif-core';
|
||||||
|
import { View2D } from 'react-vtkjs-viewport';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
const {
|
const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions;
|
||||||
setViewportActive,
|
|
||||||
setViewportSpecificData,
|
|
||||||
clearViewportSpecificData
|
|
||||||
} = OHIF.redux.actions;
|
|
||||||
|
|
||||||
const mapStateToProps = (state, ownProps) => {
|
const mapStateToProps = (state, ownProps) => {
|
||||||
const activeButton = state.tools.buttons.find(tool => tool.active === true);
|
|
||||||
let dataFromStore;
|
let dataFromStore;
|
||||||
|
|
||||||
if (state.extensions && state.extensions.vtk) {
|
if (state.extensions && state.extensions.vtk) {
|
||||||
@ -19,9 +14,6 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
// If this is the active viewport, enable prefetching.
|
// If this is the active viewport, enable prefetching.
|
||||||
const { viewportIndex } = ownProps;
|
const { viewportIndex } = ownProps;
|
||||||
const isActive = viewportIndex === state.viewports.activeViewportIndex;
|
const isActive = viewportIndex === state.viewports.activeViewportIndex;
|
||||||
const viewportSpecificData =
|
|
||||||
state.viewports.viewportSpecificData[viewportIndex] || {};
|
|
||||||
|
|
||||||
const viewportLayout = state.viewports.layout.viewports[viewportIndex];
|
const viewportLayout = state.viewports.layout.viewports[viewportIndex];
|
||||||
const pluginDetails = viewportLayout.vtk || {};
|
const pluginDetails = viewportLayout.vtk || {};
|
||||||
|
|
||||||
@ -29,7 +21,8 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
layout: state.viewports.layout,
|
layout: state.viewports.layout,
|
||||||
isActive,
|
isActive,
|
||||||
...pluginDetails,
|
...pluginDetails,
|
||||||
activeTool: activeButton && activeButton.command,
|
// Hopefully this doesn't break anything under the hood for this one
|
||||||
|
// activeTool: activeButton && activeButton.command,
|
||||||
...dataFromStore,
|
...dataFromStore,
|
||||||
enableStackPrefetch: isActive
|
enableStackPrefetch: isActive
|
||||||
};
|
};
|
||||||
@ -51,7 +44,6 @@ const mapDispatchToProps = (dispatch, ownProps) => {
|
|||||||
|
|
||||||
const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
|
const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
|
||||||
const { afterCreation } = propsFromState;
|
const { afterCreation } = propsFromState;
|
||||||
const { setViewportSpecificData } = propsFromDispatch;
|
|
||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
...propsFromState,
|
...propsFromState,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user