[Updater > Host > Linux] Fix request getting

This commit is contained in:
Ducko 2022-01-28 20:55:30 +00:00
parent 23e72de71b
commit 9db4c31be2
1 changed files with 3 additions and 3 deletions

View File

@ -28,10 +28,10 @@ class HostLinux extends events.EventEmitter {
this.emit('checking-for-update');
try {
const [, response ] = await new Promise((res) => request.get(this.updateUrl, res));
if (response.statusCode === 204) return this.emit('update-not-available');
const res = await new Promise((res) => request.get(this.updateUrl, (_e, r) => res(r)));
if (res.statusCode === 204) return this.emit('update-not-available');
const latest = versionParse(JSON.parse(response.body).name);
const latest = versionParse(JSON.parse(res.body).name);
if (versionNewer(latest, current)) {
log('HostLinux', 'Outdated');