From 6397ff528d3ec6fe2750a619a8be3b590a8da813 Mon Sep 17 00:00:00 2001 From: William Chong Date: Mon, 20 Feb 2023 12:17:39 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20Add=20locale=20to=20computed=20r?= =?UTF-8?q?oute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NFTMessage/Identity.vue | 4 ++-- src/components/NFTPortfolio/Item.vue | 9 ++++++--- src/mixins/nft.js | 20 +++++++++++--------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/components/NFTMessage/Identity.vue b/src/components/NFTMessage/Identity.vue index 569636385..5d1846e47 100644 --- a/src/components/NFTMessage/Identity.vue +++ b/src/components/NFTMessage/Identity.vue @@ -72,11 +72,11 @@ export default { }, computed: { toRoute() { - return { + return this.localeLocation({ name: 'id', params: { id: this.walletAddress }, query: { tab: this.type === 'creator' ? 'created' : 'collected' }, - }; + }); }, userLabel() { return this.$t( diff --git a/src/components/NFTPortfolio/Item.vue b/src/components/NFTPortfolio/Item.vue index 46967499b..7ee50ae85 100644 --- a/src/components/NFTPortfolio/Item.vue +++ b/src/components/NFTPortfolio/Item.vue @@ -71,15 +71,18 @@ export default { }, detailsPageRoute() { if (this.nftIdForDetails) { - return { + return this.localeLocation({ name: 'nft-class-classId-nftId', params: { classId: this.classId, nftId: this.nftIdForDetails, }, - }; + }); } - return { name: 'nft-class-classId', params: { classId: this.classId } }; + return this.localeLocation({ + name: 'nft-class-classId', + params: { classId: this.classId }, + }); }, }, methods: { diff --git a/src/mixins/nft.js b/src/mixins/nft.js index 6ab4b3877..3a88b4cd3 100644 --- a/src/mixins/nft.js +++ b/src/mixins/nft.js @@ -340,15 +340,17 @@ export default { : this.purchaseInfo?.nftId; }, nftCollectRoute() { - return this.nftIsCollectable && this.nftIdCollectNext - ? { - name: 'nft-class-classId-nftId', - params: { classId: this.classId, nftId: this.nftIdCollectNext }, - } - : { - name: 'nft-class-classId', - params: { classId: this.classId }, - }; + return this.localeLocation( + this.nftIsCollectable && this.nftIdCollectNext + ? { + name: 'nft-class-classId-nftId', + params: { classId: this.classId, nftId: this.nftIdCollectNext }, + } + : { + name: 'nft-class-classId', + params: { classId: this.classId }, + } + ); }, canCollectWithoutWallet() { return (