Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
IbrahimCSAE committed Nov 22, 2024
1 parent d8ef36e commit 10e02ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions platform/app/src/routes/Mode/Mode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ export default function ModeRoute({
: hangingProtocol;

// Determine the index of the stageId if the hangingProtocolIdToUse is defined
const stageIndex = hangingProtocolIdToUse
? hangingProtocolService.getStageIndex(hangingProtocolIdToUse, {
const stageIndex = Array.isArray(hangingProtocolIdToUse)
? -1
: hangingProtocolService.getStageIndex(hangingProtocolIdToUse, {
stageId: runTimeStageId || undefined,
})
: -1;
});
// Ensure that the stage index is never negative
// If stageIndex is negative (e.g., if stage wasn't found), use 0 as the default
const stageIndexToUse = Math.max(0, stageIndex);
Expand Down

0 comments on commit 10e02ec

Please sign in to comment.