chore: handle function not set (preserve non-breaking)

This commit is contained in:
dannyrb 2020-02-24 11:22:41 -05:00
parent 141e1cf648
commit 298da03e2f

View File

@ -74,7 +74,9 @@ class ToolbarRow extends Component {
// It's a bit beefy to pass studies; probably only need to be reactive on `studyInstanceUIDs` and activeViewport?
// Note: This does not cleanly handle `studies` prop updating with panel open
const isDisabled = menuOption.isDisabled(this.props.studies);
const isDisabled =
typeof menuOption.isDisabled === 'function' &&
menuOption.isDisabled(this.props.studies);
if (hasActiveContext && !isDisabled) {
const menuOptionEntry = {