Skip to content

Commit

Permalink
πŸ› Add computed property for newsPress
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Sep 29, 2024
1 parent d553880 commit 5d34156
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pages/nft/url/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ export default class FetchIndex extends Vue {
return new RegExp(ISCN_PREFIX_REGEX);
}
get isNewsPress() {
return !!this.$route.query.news_press && this.$route.query.news_press !== '0'
}
async mounted() {
if (this.iscnId) {
if (!this.isUpdateMode) {
Expand Down Expand Up @@ -643,13 +647,12 @@ export default class FetchIndex extends Vue {
}
async crawlUrlData() {
const isNewsPress = !!this.$route.query.news_press && this.$route.query.news_press !== '0'
try {
logTrackerEvent(this, 'NFTUrlMint', 'CrawlUrlData', this.url, 1);
const { data } = await this.$axios.get(`/crawler/?url=${encodeURIComponent(this.encodedURL)}&wallet=${this.address}`)
const { title, description, author, body, images = [] } = data;
let { keywords } = data;
if (isNewsPress) {
if (this.isNewsPress) {
keywords = keywords ? `${keywords},NewsPress` : 'NewsPress';
}
if (!body) { throw new Error('CANNOT_CRAWL_THIS_URL') }
Expand Down

0 comments on commit 5d34156

Please sign in to comment.