Skip to content

Commit

Permalink
fix bug in SetOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya-dobri committed Nov 16, 2024
1 parent 1442943 commit b972e99
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/widgets/OperationTypes/SetOptions/ui/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,12 @@ const SetOptions: FC<Props> = ({ id }) => {
onChange={handleInputChange("master_weight")}
validate={validateRange}
errorMessage="Expected an integer between 0 and 255 (inclusive)."
warningMessage={+masterWeightValue > 0 ? "This can result in a permanently locked account. Are you sure you know what you're doing? " : ""}
warningMessage={
masterWeightValue !== "" && +masterWeightValue >= 0
? "This can result in a permanently locked account. Are you sure you know what you're doing?"
: ""
}

/>

<InputField
Expand All @@ -395,7 +400,11 @@ const SetOptions: FC<Props> = ({ id }) => {
onChange={handleInputChange("med_threshold")}
validate={validateRange}
errorMessage="Expected an integer between 0 and 255 (inclusive)."
warningMessage={+mediumThresholdValue > 0 ? "This can result in a permanently locked account. Are you sure you know what you're doing? " : ""}
warningMessage={
mediumThresholdValue !== "" && +mediumThresholdValue >= 0
? "This can result in a permanently locked account. Are you sure you know what you're doing?"
: ""
}
/>

<InputField
Expand All @@ -405,10 +414,17 @@ const SetOptions: FC<Props> = ({ id }) => {
onChange={handleInputChange("high_threshold")}
validate={validateRange}
errorMessage="Expected an integer between 0 and 255 (inclusive)."
warningMessage={+highThresholdValue > 0 ? "This can result in a permanently locked account. Are you sure you know what you're doing? " : ""}

warningMessage={
highThresholdValue !== "" && +highThresholdValue >= 0
? "This can result in a permanently locked account. Are you sure you know what you're doing?"
: ""
}

/>

<div className={s.section}>

<h4 className={s.sectionTitle}>
Signer Type <span className={s.optional}>(optional)</span>
</h4>
Expand Down

0 comments on commit b972e99

Please sign in to comment.