Skip to content

Commit

Permalink
Merge pull request #980 from liquality/ext-253/gas-fee-handler
Browse files Browse the repository at this point in the history
Ext 253/gas fee handler
  • Loading branch information
bradleySuira authored Jan 13, 2023
2 parents 01a8285 + 0b035fe commit 0c9c126
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "liquality-wallet",
"version": "0.83.0",
"version": "0.83.1",
"private": true,
"author": "Liquality <[email protected]>",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"version": "0.83.0",
"version": "0.83.1",
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
Expand Down
27 changes: 17 additions & 10 deletions src/views/Send/Send.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
{{ $t('common.send') }}
</NavBar>
<InfoNotification v-if="nativeAssetRequired">
<EthRequiredMessage :account-id="account.id" :action="'send'" />
{{ $t('components.noFundsForNetworkFee.noEnoughAsset', { asset: assetChain }) }}
<router-link :to="accountUrl" class="btn btn-option get-bridgeAsset-btn">
{{ $t('common.get') }} {{ assetChain }}
</router-link>
</InfoNotification>
<InfoNotification v-else-if="!isValidSendAmount">
{{ `${$t('common.minSendAmount')} ${minimumAssetSendAmount} ${asset}` }}
Expand Down Expand Up @@ -290,7 +293,6 @@ import { UNSResolver } from '@liquality/wallet-core/dist/src/nameResolvers/uns'
import { errorToLiqualityErrorString } from '@liquality/error-parser/dist/src/utils'
import { reportLiqualityError } from '@liquality/error-parser/dist/src/reporters/index'
import InfoNotification from '@/components/InfoNotification'
import EthRequiredMessage from '@/components/EthRequiredMessage'
export default {
components: {
Expand All @@ -303,8 +305,7 @@ export default {
LedgerSignRequestModal,
CustomFees,
CustomFeesEIP1559,
InfoNotification,
EthRequiredMessage
InfoNotification
},
mixins: [ledgerConnectMixin],
data() {
Expand Down Expand Up @@ -351,6 +352,9 @@ export default {
...mapState(['activeNetwork', 'activeWalletId', 'fees', 'fiatRates']),
...mapGetters('app', ['ledgerBridgeReady']),
...mapGetters(['accountItem', 'client', 'suggestedFeePrices']),
accountUrl() {
return `/accounts/${this.accountId}/${this.nativeAsset}/receive`
},
account() {
return this.accountItem(this.accountId)
},
Expand Down Expand Up @@ -470,12 +474,14 @@ export default {
return true
}
const nativeAssetBalance = this.networkWalletBalances[this.assetChain]
if (
!nativeAssetBalance ||
BN(nativeAssetBalance).lte(0) ||
BN(nativeAssetBalance).minus(BN(this.currentFee)).lt(0)
) {
const balance = this.networkWalletBalances[this.assetChain]
if (!balance) {
return true
}
const nativeAssetBalance = unitToCurrency(cryptoassets[this.assetChain], BN(balance))
if (nativeAssetBalance.lte(0) || nativeAssetBalance.minus(BN(this.currentFee)).lte(0)) {
return true
}
return false
Expand Down Expand Up @@ -552,6 +558,7 @@ export default {
getAssetIcon,
getAssetColorStyle,
shortenAddress,
getNativeAsset,
updateSendAmount(newValue) {
if (newValue && !isNaN(newValue)) {
this.stateAmount = newValue
Expand Down
2 changes: 1 addition & 1 deletion src/views/Send/SendNFT.vue
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ export default {
]).finally(() => {
setTimeout(() => {
this.updatingFees = false
}, 1000);
}, 1000)
})
}
}
Expand Down

0 comments on commit 0c9c126

Please sign in to comment.