Skip to content

Commit

Permalink
fix: some fixes for nft screens
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleySuira committed Jan 11, 2023
1 parent b720176 commit 09af5aa
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "liquality-wallet",
"version": "0.82.12",
"version": "0.82.13",
"private": true,
"author": "Liquality <info@liquality.io>",
"scripts": {
Expand Down Expand Up @@ -29,7 +29,7 @@
"@liquality/ethereum-utils": "^1.13.12",
"@liquality/terra-networks": "^1.13.12",
"@liquality/types": "^1.13.12",
"@liquality/wallet-core": "4.5.0",
"@liquality/wallet-core": "4.6.0",
"@terra-money/terra.js": "^3.1.6",
"@testing-library/vue": "^5.8.2",
"amplitude-js": "8.18.2",
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.82.12",
"version": "0.82.13",
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
Expand Down
38 changes: 19 additions & 19 deletions src/views/Send/SendNFT.vue
Original file line number Diff line number Diff line change
Expand Up @@ -346,20 +346,13 @@ export default {
sendErrorMessage: '',
address: '',
selectedFee: 'average',
updatingFees: true
updatingFees: false
}
},
watch: {
activeView: {
handler: async function (newVal) {
if (newVal === 'selectedAsset') {
this.updatingFees = true
await this.updateFees({ asset: this.assetChain })
await this.updateSendFees(this.amount)
setTimeout(() => {
this.updatingFees = false
}, 1500)
}
activeView(newVal) {
if (newVal === 'selectedAsset' && this.selectedNFT && !this.updatingFees) {
this.requestUpdateFees()
}
}
},
Expand All @@ -371,13 +364,9 @@ export default {
const collections = this.accountNftCollections(this.accountId)
if (collections && collections[collectionName]) {
this.selectedNFT = collections[collectionName].find((i) => i.token_id == nftAssetId)
this.requestUpdateFees()
}
}
await this.updateFees({ asset: this.assetChain })
await this.updateSendFees(this.amount)
setTimeout(() => {
this.updatingFees = false
}, 1500)
await this.trackAnalytics({
event: 'Send NFT screen',
properties: {
Expand Down Expand Up @@ -617,13 +606,13 @@ export default {
this.customFee = null
this.selectedFee = 'average'
},
async _updateSendFees() {
async _updateSendFees(amount = 1) {
if (!this.selectedNFT) return
const sendFees = await estimateTransferNFT(
this.account.id,
this.activeNetwork,
this.address,
[1],
[amount],
this.selectedNFT,
this.customFee
)
Expand All @@ -636,7 +625,7 @@ export default {
)
if (BN(this.balance).gt(0)) {
console.log('Updating fees')
await this._updateSendFees(amount)
await this._updateSendFees()
} else {
console.log('balance <= 0, not updating fees')
}
Expand Down Expand Up @@ -685,6 +674,17 @@ export default {
if (ref) {
this.$refs[ref].src = this.thumbnailImage
}
},
requestUpdateFees() {
this.updatingFees = true
Promise.all([
this.updateFees({ asset: this.assetChain }),
this.updateSendFees(this.amount)
]).finally(() => {
setTimeout(() => {
this.updatingFees = false
}, 1000);
})
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/Wallet/NFTActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default {
},
computed: {
...mapState(['activeNetwork', 'history']),
...mapGetters(['activity', 'accountsData', 'accountNftCollections']),
...mapGetters(['activity', 'accountItem', 'accountNftCollections']),
assetHistory() {
return this.activity.filter((item) => item.type === 'NFT' && item.accountId === this.id)
},
Expand All @@ -100,10 +100,10 @@ export default {
return Object.values(this.nftAssets).reduce((acc, collection) => acc + collection.length, 0)
},
account() {
return this.accountsData.filter((account) => account.id === this.id)[0]
return this.accountItem(this.id)
},
asset() {
return getNativeAssetCode(this.activeNetwork, this.account.chain)
return getNativeAssetCode(this.activeNetwork, this.account?.chain)
}
},
methods: {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4013,9 +4013,9 @@ __metadata:
languageName: node
linkType: hard

"@liquality/wallet-core@npm:4.5.0":
version: 4.5.0
resolution: "@liquality/wallet-core@npm:4.5.0"
"@liquality/wallet-core@npm:4.6.0":
version: 4.6.0
resolution: "@liquality/wallet-core@npm:4.6.0"
dependencies:
"@blobfishkate/sovryncontracts": 1.3.27
"@chainify/bitcoin": 2.2.0
Expand Down Expand Up @@ -4065,7 +4065,7 @@ __metadata:
urql: ^2.2.0
vue: ^2.6.11
vuex: ^3.1.3
checksum: 1e38b38b2523f7b3bf3dccae4b7f16bf8c81627ddec10bd7bcadc6c47f9eaa39cefe000fc4d7c5070a126c81ce374c4c3d5e97d7a360ffcb45a86804ae0edd84
checksum: 46aac8f0b16ad7dc2061bebe93c386ebc08154ba978c57fb3fdbad89848a795650f3318fe2e88f540c28feca299c70e5dbdb69bbb09bbe582bafdadfc62d627b
languageName: node
linkType: hard

Expand Down Expand Up @@ -18762,7 +18762,7 @@ __metadata:
"@liquality/ethereum-utils": ^1.13.12
"@liquality/terra-networks": ^1.13.12
"@liquality/types": ^1.13.12
"@liquality/wallet-core": 4.5.0
"@liquality/wallet-core": 4.6.0
"@terra-money/terra.js": ^3.1.6
"@testing-library/jest-dom": 5.16.5
"@testing-library/vue": ^5.8.2
Expand Down

0 comments on commit 09af5aa

Please sign in to comment.