Skip to content

Commit 09af5aa

Browse files
committed
fix: some fixes for nft screens
1 parent b720176 commit 09af5aa

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "liquality-wallet",
3-
"version": "0.82.12",
3+
"version": "0.82.13",
44
"private": true,
55
"author": "Liquality <info@liquality.io>",
66
"scripts": {
@@ -29,7 +29,7 @@
2929
"@liquality/ethereum-utils": "^1.13.12",
3030
"@liquality/terra-networks": "^1.13.12",
3131
"@liquality/types": "^1.13.12",
32-
"@liquality/wallet-core": "4.5.0",
32+
"@liquality/wallet-core": "4.6.0",
3333
"@terra-money/terra.js": "^3.1.6",
3434
"@testing-library/vue": "^5.8.2",
3535
"amplitude-js": "8.18.2",

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"manifest_version": 2,
3-
"version": "0.82.12",
3+
"version": "0.82.13",
44
"name": "__MSG_appName__",
55
"description": "__MSG_appDesc__",
66
"default_locale": "en",

src/views/Send/SendNFT.vue

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -346,20 +346,13 @@ export default {
346346
sendErrorMessage: '',
347347
address: '',
348348
selectedFee: 'average',
349-
updatingFees: true
349+
updatingFees: false
350350
}
351351
},
352352
watch: {
353-
activeView: {
354-
handler: async function (newVal) {
355-
if (newVal === 'selectedAsset') {
356-
this.updatingFees = true
357-
await this.updateFees({ asset: this.assetChain })
358-
await this.updateSendFees(this.amount)
359-
setTimeout(() => {
360-
this.updatingFees = false
361-
}, 1500)
362-
}
353+
activeView(newVal) {
354+
if (newVal === 'selectedAsset' && this.selectedNFT && !this.updatingFees) {
355+
this.requestUpdateFees()
363356
}
364357
}
365358
},
@@ -371,13 +364,9 @@ export default {
371364
const collections = this.accountNftCollections(this.accountId)
372365
if (collections && collections[collectionName]) {
373366
this.selectedNFT = collections[collectionName].find((i) => i.token_id == nftAssetId)
367+
this.requestUpdateFees()
374368
}
375369
}
376-
await this.updateFees({ asset: this.assetChain })
377-
await this.updateSendFees(this.amount)
378-
setTimeout(() => {
379-
this.updatingFees = false
380-
}, 1500)
381370
await this.trackAnalytics({
382371
event: 'Send NFT screen',
383372
properties: {
@@ -617,13 +606,13 @@ export default {
617606
this.customFee = null
618607
this.selectedFee = 'average'
619608
},
620-
async _updateSendFees() {
609+
async _updateSendFees(amount = 1) {
621610
if (!this.selectedNFT) return
622611
const sendFees = await estimateTransferNFT(
623612
this.account.id,
624613
this.activeNetwork,
625614
this.address,
626-
[1],
615+
[amount],
627616
this.selectedNFT,
628617
this.customFee
629618
)
@@ -636,7 +625,7 @@ export default {
636625
)
637626
if (BN(this.balance).gt(0)) {
638627
console.log('Updating fees')
639-
await this._updateSendFees(amount)
628+
await this._updateSendFees()
640629
} else {
641630
console.log('balance <= 0, not updating fees')
642631
}
@@ -685,6 +674,17 @@ export default {
685674
if (ref) {
686675
this.$refs[ref].src = this.thumbnailImage
687676
}
677+
},
678+
requestUpdateFees() {
679+
this.updatingFees = true
680+
Promise.all([
681+
this.updateFees({ asset: this.assetChain }),
682+
this.updateSendFees(this.amount)
683+
]).finally(() => {
684+
setTimeout(() => {
685+
this.updatingFees = false
686+
}, 1000);
687+
})
688688
}
689689
}
690690
}

src/views/Wallet/NFTActivity.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default {
8989
},
9090
computed: {
9191
...mapState(['activeNetwork', 'history']),
92-
...mapGetters(['activity', 'accountsData', 'accountNftCollections']),
92+
...mapGetters(['activity', 'accountItem', 'accountNftCollections']),
9393
assetHistory() {
9494
return this.activity.filter((item) => item.type === 'NFT' && item.accountId === this.id)
9595
},
@@ -100,10 +100,10 @@ export default {
100100
return Object.values(this.nftAssets).reduce((acc, collection) => acc + collection.length, 0)
101101
},
102102
account() {
103-
return this.accountsData.filter((account) => account.id === this.id)[0]
103+
return this.accountItem(this.id)
104104
},
105105
asset() {
106-
return getNativeAssetCode(this.activeNetwork, this.account.chain)
106+
return getNativeAssetCode(this.activeNetwork, this.account?.chain)
107107
}
108108
},
109109
methods: {

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4013,9 +4013,9 @@ __metadata:
40134013
languageName: node
40144014
linkType: hard
40154015

4016-
"@liquality/wallet-core@npm:4.5.0":
4017-
version: 4.5.0
4018-
resolution: "@liquality/wallet-core@npm:4.5.0"
4016+
"@liquality/wallet-core@npm:4.6.0":
4017+
version: 4.6.0
4018+
resolution: "@liquality/wallet-core@npm:4.6.0"
40194019
dependencies:
40204020
"@blobfishkate/sovryncontracts": 1.3.27
40214021
"@chainify/bitcoin": 2.2.0
@@ -4065,7 +4065,7 @@ __metadata:
40654065
urql: ^2.2.0
40664066
vue: ^2.6.11
40674067
vuex: ^3.1.3
4068-
checksum: 1e38b38b2523f7b3bf3dccae4b7f16bf8c81627ddec10bd7bcadc6c47f9eaa39cefe000fc4d7c5070a126c81ce374c4c3d5e97d7a360ffcb45a86804ae0edd84
4068+
checksum: 46aac8f0b16ad7dc2061bebe93c386ebc08154ba978c57fb3fdbad89848a795650f3318fe2e88f540c28feca299c70e5dbdb69bbb09bbe582bafdadfc62d627b
40694069
languageName: node
40704070
linkType: hard
40714071

@@ -18762,7 +18762,7 @@ __metadata:
1876218762
"@liquality/ethereum-utils": ^1.13.12
1876318763
"@liquality/terra-networks": ^1.13.12
1876418764
"@liquality/types": ^1.13.12
18765-
"@liquality/wallet-core": 4.5.0
18765+
"@liquality/wallet-core": 4.6.0
1876618766
"@terra-money/terra.js": ^3.1.6
1876718767
"@testing-library/jest-dom": 5.16.5
1876818768
"@testing-library/vue": ^5.8.2

0 commit comments

Comments
 (0)