Skip to content

Commit

Permalink
🌐 Add locale to computed route
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong authored and nwingt committed Feb 20, 2023
1 parent 4d8a142 commit 6397ff5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/components/NFTMessage/Identity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 6 additions & 3 deletions src/components/NFTPortfolio/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
20 changes: 11 additions & 9 deletions src/mixins/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 6397ff5

Please sign in to comment.