Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Add computed property for newsPress #487

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@ -412,7 +416,7 @@
});
window.opener.postMessage(message, this.redirectOrigin);
} catch (err) {
console.error(err);

Check warning on line 419 in pages/nft/url/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

Unexpected console statement
}
}
}
Expand Down Expand Up @@ -643,13 +647,12 @@
}

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 Expand Up @@ -750,7 +753,7 @@
});
window.opener.postMessage(message, this.redirectOrigin);
} catch (err) {
console.error(err);

Check warning on line 756 in pages/nft/url/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

Unexpected console statement
}
}
} catch (err) {
Expand Down Expand Up @@ -808,7 +811,7 @@
});
window.opener.postMessage(message, this.redirectOrigin);
} catch (err) {
console.error(err);

Check warning on line 814 in pages/nft/url/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

Unexpected console statement
}
}
logTrackerEvent(this, 'NFTUrlMint', 'RegisterISCNSuccess', this.iscnId, 1);
Expand Down
Loading