Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Commit

Permalink
Refactor getLatestTag function
Browse files Browse the repository at this point in the history
  • Loading branch information
necipsagiro committed Feb 8, 2024
1 parent 98588b4 commit 868bd62
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/node-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,13 @@ const hideErrorMessage = () => {
const getLatestTag = async () => {
const client = await http.getClient();
try {
const repoUrl = all_projects.find(item => item.project.name == currentIp.icon).social_media_accounts.github;
latest_tag = (await client.get(`https://api.github.com/repos${repoUrl.split("github.com")[1]}/releases/latest`, {
type: 'Json'
})).data.tag_name;
// const repoUrl = all_projects.find(item => item.project.name == currentIp.icon).social_media_accounts.github;
// latest_tag = (await client.get(`https://api.github.com/repos${repoUrl.split("github.com")[1]}/releases/latest`, {
// type: 'Json'
// })).data.tag_name;
const temp = all_projects.find(item => item.project.name == currentIp.icon).latest_version;
console.log("temp", temp);
latest_tag = temp ? temp : "v0.0.0";
} catch (e) {
latest_tag = "v0.0.0";
}
Expand Down

0 comments on commit 868bd62

Please sign in to comment.