Skip to content

Commit

Permalink
add one more safety check around mask channel
Browse files Browse the repository at this point in the history
  • Loading branch information
toloudis committed Dec 5, 2024
1 parent c49bbdd commit 4018bb4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/aics-image-viewer/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,13 @@ const App: React.FC<AppProps> = (props) => {
? newChannelSettings.map((channel, index) => (channel.volumeEnabled ? index : -1)).filter((index) => index >= 0)
: [];

// add mask channel to required channels?
const maskChannelName = getCurrentViewerChannelSettings()?.maskChannelName || "";
const maskChannelIndex = channelNames.indexOf(maskChannelName);
if (maskChannelIndex >= 0 && !requiredChannelsToLoad.includes(maskChannelIndex)) {
requiredChannelsToLoad.push(maskChannelIndex);
// add mask channel to required channels, if specified
const maskChannelName = getCurrentViewerChannelSettings()?.maskChannelName;
if (maskChannelName) {
const maskChannelIndex = channelNames.indexOf(maskChannelName);
if (maskChannelIndex >= 0 && !requiredChannelsToLoad.includes(maskChannelIndex)) {
requiredChannelsToLoad.push(maskChannelIndex);
}
}
requiredLoadSpec.channels = requiredChannelsToLoad;

Expand Down

0 comments on commit 4018bb4

Please sign in to comment.