mirror of
https://gitlab.com/ryzen-controller-team/ryzen-controller.git
synced 2024-12-22 18:13:28 +07:00
Fixes RYZEN-CONTROLLER-40 - Detect when checkForNewRelease is failing.
This commit is contained in:
parent
a7b0362f0f
commit
22be46426c
@ -497,18 +497,22 @@ function checkForNewRelease() {
|
|||||||
var request = new XMLHttpRequest();
|
var request = new XMLHttpRequest();
|
||||||
const version = require('./package.json').version;
|
const version = require('./package.json').version;
|
||||||
|
|
||||||
request.open('GET', 'https://gitlab.com/api/v4/projects/11046417/releases', true);
|
try {
|
||||||
|
request.open('GET', 'https://gitlab.com/api/v4/projects/11046417/releases', true);
|
||||||
|
|
||||||
request.onload = function() {
|
request.onload = function() {
|
||||||
if (this.status >= 200 && this.status < 400) {
|
if (this.status >= 200 && this.status < 400) {
|
||||||
var resp = JSON.parse(this.response);
|
var resp = JSON.parse(this.response);
|
||||||
if (resp[0].tag_name !== version) {
|
if (resp[0].tag_name !== version) {
|
||||||
notification('primary', "A new vesion is available, please check the release tab.");
|
notification('primary', "A new vesion is available, please check the release tab.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
|
|
||||||
request.send();
|
request.send();
|
||||||
|
} catch (error) {
|
||||||
|
console.log('Unable to check if new release is available.', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user