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

This commit is contained in:
dannyrb committed 2020-02-24 11:22:41 -05:00
1 parent 141e1cf648
commit 298da03e2f
1 file changed
+3 -1
@@ -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 = {