Skip to content

Commit

Permalink
fix: add an error message logic
Browse files Browse the repository at this point in the history
  • Loading branch information
impelcrypto committed Jul 4, 2023
1 parent a76df74 commit 5d7e431
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/hooks/xcm/useXcmBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,13 @@ export function useXcmBridge(selectedToken: Ref<Asset>) {
return;
}

const isBlankDestAddressToEvm =
isWithdrawalEthChain.value && sendingAmount && !inputtedAddress.value;
if (isBlankDestAddressToEvm) {
errMsg.value = t('warning.blankDestAddress');
return;
}

if (isDeposit.value) {
if (!checkIsEnoughMinBal(sendingAmount)) {
errMsg.value = t('warning.insufficientOriginChainBalance', {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default {
insufficientBalance: 'Insufficient {token} balance',
insufficientFee: 'Warning! Transaction might fail due to insufficient fee',
inputtedInvalidDestAddress: 'Inputted invalid destination address',
blankDestAddress: 'Destination address is blank',
inputtedInvalidAddress: 'Inputted invalid address',
selectedInvalidNetworkInWallet: 'Selected invalid network in your wallet',
insufficientBridgeAmount: 'Minimum transfer amount is {amount} {token}',
Expand Down

0 comments on commit 5d7e431

Please sign in to comment.