Skip to content

Commit

Permalink
chore: Add warning alert for claiming rewards when Amount less than t…
Browse files Browse the repository at this point in the history
…he fee
  • Loading branch information
Ysrbolles committed Sep 10, 2024
1 parent 5294f8c commit 96912fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/components/wallet/earn/ModalClaimDepositReward.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
}}
</p>
</div>
<Alert variant="warning" v-if="isAmountLessThanTxFee">
{{ $t('earn.rewards.claim_modal.alert_info_message') }}
</Alert>
<div class="modal-buttons">
<CamBtn variant="transparent" @click="close()">
{{ $t('earn.rewards.claim_modal.cancel') }}
Expand Down Expand Up @@ -78,12 +81,14 @@ import Modal from '../../modals/Modal.vue'
import CamBtn from '@/components/CamBtn.vue'
import { cleanAvaxBN } from '@/helpers/helper'
import { ZeroBN } from '@/constants'
import Alert from '@/components/Alert.vue'
@Component({
components: {
AvaxInput,
Modal,
CamBtn,
Alert,
},
})
export default class ModalClaimDepositReward extends Vue {
Expand Down Expand Up @@ -138,7 +143,11 @@ export default class ModalClaimDepositReward extends Vue {
}
get feeAmt(): string {
return this.formattedAmount(ava.PChain().getTxFee())
return this.cleanAvaxBN(ava.PChain().getTxFee())
}
get isAmountLessThanTxFee(): boolean {
return this.amt.lt(ava.PChain().getTxFee())
}
get ava_asset(): AvaAsset | null {
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@
"confirmation_message": "{amount} {symbol} has been claimed.",
"signature_collected": "Your signature has been collected.",
"confirm": "Confirm",
"cancel": "Cancel"
"cancel": "Cancel",
"alert_info_message": "The requested claim operation will claim less funds than the transaction will cost. Please confirm that you want to proceed with this operation."
},
"abort_modal": {
"title": "Abort Claim Rewards",
Expand Down

0 comments on commit 96912fe

Please sign in to comment.