Skip to content

Commit

Permalink
fix(wallet-mobile): stepper progress crash (#3613)
Browse files Browse the repository at this point in the history
  • Loading branch information
stackchain authored Sep 10, 2024
2 parents 16dec34 + 0ce0349 commit 8cc6c56
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ export const StepperProgress = ({currentStep, currentStepTitle, totalSteps, styl

if (currentStep > totalSteps) throw new Error("StepperProgress: currentStep can't be greater that totalSteps")

// 4 non empty icons
// 3 empty icons
if (4 < totalSteps || 3 < totalSteps) throw new Error('StepperProgress: total steps greater that number of icons')
// 4 non empty icons > 3 empty icons
if (4 < totalSteps) throw new Error('StepperProgress: not enough icons to cover total steps')

const stepIndicatorFirstPart: Array<React.ReactNode> = Array.from({length: currentStep}).map((_, index) => {
if (index <= currentStep - 2) return <CheckIllustration key={index} />
Expand Down

0 comments on commit 8cc6c56

Please sign in to comment.