Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
Fix update notif when pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
vincelwt committed Sep 10, 2016
1 parent 935ae1f commit b0cdd4c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ function getData() {

var xhr = new XMLHttpRequest();

xhr.open("GET", "https://api.github.com/repos/vincelwt/harmony/releases", true);
xhr.open("GET", "https://api.github.com/repos/vincelwt/harmony/releases/latest", true);

xhr.onload = function (e) {
if (xhr.readyState === 4 && xhr.status === 200) {
var newUpdate = JSON.parse(xhr.responseText);

console.log("Latest release is "+newUpdate[0].tag_name);
console.log("Latest release is "+newUpdate.tag_name);

if (newUpdate[0].tag_name > process.env.npm_package_version)
if (newUpdate.tag_name > process.env.npm_package_version)
notifier.notify({'title': 'Update available', 'message': 'A new version of Harmony is available, visit the website'});

}
Expand Down

0 comments on commit b0cdd4c

Please sign in to comment.