Skip to content

Commit

Permalink
Fix kiidrv & dfu-check
Browse files Browse the repository at this point in the history
If the github release check fails (i.e. A published, non pre-release,
build does not exist), then the rest of the update functions are not
ran.
  • Loading branch information
smasher816 committed Nov 2, 2019
1 parent acdcdd7 commit 8da726a
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/renderer/state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,29 @@ export async function checkVersion() {
}

const uri = 'https://api.github.com/repos/hexgears/configurator/releases/latest';
const response = await fetch(uri, {
method: 'GET',
headers: {
'User-Agent': 'Kiibohd Configurator',
Accept: 'application/json; charset=utf-8'
}
}).then(r => r.json());
try {
const response = await fetch(uri, {
method: 'GET',
headers: {
'User-Agent': 'Kiibohd Configurator',
Accept: 'application/json; charset=utf-8'
}
}).then(r => r.json());
console.log(response);

const version = electron.remote.app.getVersion();
const latest = response.tag_name;
const newerAvail = compareVersions(latest, version) > 0;
updateNewerVersionAvail(newerAvail);
if (newerAvail) {
return {
version: latest,
url: response.html_url
};
const version = electron.remote.app.getVersion();
const latest = response.tag_name;
const newerAvail = compareVersions(latest, version) > 0;
updateNewerVersionAvail(newerAvail);
if (newerAvail) {
return {
version: latest,
url: response.html_url
};
}
} catch (e) {
// No version found
return;
}
}

Expand Down

0 comments on commit 8da726a

Please sign in to comment.