Skip to content

Commit

Permalink
Merge pull request #6832 from LedgerHQ/fix/LIVE-12485
Browse files Browse the repository at this point in the history
fix(llm):  cosmos error message for stake
  • Loading branch information
sshmaxime committed May 17, 2024
2 parents c568422 + dd592ce commit cfbf9c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-insects-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

Fix error message for cosmos staking. It was showing minimum amount : 0000 when we wanted to stake more than the current balance
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ function DelegationAmount({ navigation, route }: Props) {
behaviorParam = "padding";
}

const errorMessageKey =
isNotEnoughBalance || isAmountOutOfRange
? "errors.NotEnoughBalance.title"
: value.gte(min)
? "cosmos.delegation.flow.steps.amount.minAmount"
: "cosmos.delegation.flow.steps.amount.incorrectAmount";

return (
<View
style={[
Expand Down Expand Up @@ -190,13 +197,7 @@ function DelegationAmount({ navigation, route }: Props) {
<Warning size={16} color={colors.error.c50} />
<LText style={[styles.assetsRemaining]} color={colors.error.c50}>
<Trans
i18nKey={
isNotEnoughBalance
? "errors.NotEnoughBalance.title"
: value.gte(min)
? "cosmos.delegation.flow.steps.amount.minAmount"
: "cosmos.delegation.flow.steps.amount.incorrectAmount"
}
i18nKey={errorMessageKey}
values={{
min: formatCurrencyUnit(unit, min, {
showCode: true,
Expand Down

0 comments on commit cfbf9c0

Please sign in to comment.