-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Refactor nft vs NFT vs iscn data parsing in mixin (#2082)
* ♻️ Refactor nft vs NFT vs iscn data parsing in mixin * ♻️ Move iscn to mixin * 🎨 Fix inconsistent use of NFT contentMetadata
- Loading branch information
1 parent
7d03a3e
commit 06479e4
Showing
12 changed files
with
142 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { mapActions, mapGetters } from 'vuex'; | ||
import { APP_LIKE_CO_VIEW } from '~/constant'; | ||
|
||
export default { | ||
computed: { | ||
...mapGetters(['getISCNMetadataById']), | ||
iscnId() { | ||
return ( | ||
this.NFTClassMetadata.parent?.iscnIdPrefix || | ||
this.NFTClassMetadata.parent?.iscn_id_prefix | ||
); | ||
}, | ||
iscnURL() { | ||
if (!this.iscnId) return ''; | ||
return `${APP_LIKE_CO_VIEW}/${encodeURIComponent(this.iscnId)}`; | ||
}, | ||
iscnData() { | ||
if (!this.iscnId) return undefined; | ||
const data = this.getISCNMetadataById(this.iscnId); | ||
if (data instanceof Promise) return undefined; | ||
return data; | ||
}, | ||
}, | ||
methods: { | ||
...mapActions(['lazyGetISCNMetadataById']), | ||
async fetchISCNMetadata() { | ||
await this.lazyGetISCNMetadataById(this.iscnId); | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.