Skip to content

Commit

Permalink
Fix modeFactory isValidMode condition
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Nov 28, 2023
1 parent 5bc4595 commit d40feba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modes/segmentation/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ function modeFactory({ modeConfiguration }) {
* segmentations and we should exclude them
*/
isValidMode: ({ modalities }) => {
if (modalities.length === 1) {
return !['SM', 'US', 'MG', 'OT', 'DOC', 'CR'].includes(modalities[0]);
// Don't show the mode if the selected studies have only one modality
// that is not supported by the mode
const modalitiesArray = modalities.split('\\');
if (modalitiesArray.length === 1) {
return !['SM', 'US', 'MG', 'OT', 'DOC', 'CR'].includes(modalitiesArray[0]);
}

return true;
Expand Down

0 comments on commit d40feba

Please sign in to comment.