Skip to content

Commit

Permalink
fixed updater
Browse files Browse the repository at this point in the history
  • Loading branch information
brandoshizzle committed Sep 28, 2019
1 parent 0cbdeec commit d9b0b6f
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions src/scripts/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ function checkForUpdate() {
if (!(release.prerelease === true && settingsInfo.general.prereleaseUpdates === false)) {
var rVersion = release.tag_name.substring(1);
var cVersion = pjson.version;
//cVersion = rVersion; // For testing first time updates
console.log(rVersion);
console.log(cVersion);

if (compV(rVersion, cVersion)) {
if (compV(rVersion, cVersion) === 1) {
// NEWER VERSION DETECTED, POPULATE UPDATE FORM
$('#update-cVersion').text(cVersion);
$('#update-rVersion').text(rVersion);
Expand All @@ -31,25 +27,27 @@ function checkForUpdate() {
}
$('#download-btn').attr('href', release.html_url);
$('#update-link').text('Update to v' + rVersion + '!');
} else if (compV(pjson.version, settingsInfo.utility.pVersion)) {
// Flask has been updated and is being run for the first time!
$('#update-title').text('Flask Updated!');
$('#update-cVersion').text(pjson.version);
$('#update-rVersion').text(pjson.version);
$('#update-date').text(release.published_at.substring(0, 10));
$('#update-changelog').html(marked(release.body));
$('#update-changelog > h2').remove();
$('#download-btn').hide();
$('#update-link').text('Updated to v' + pjson.version + '!');
$('#build-type').hide();
$('#download-btn').hide();
$('#update-modal-footer a').text('Okay');
} else if (settingsInfo.hasOwnProperty('utility')) {
if (compV(pjson.version, settingsInfo.utility.pVersion)) {
// Flask has been updated and is being run for the first time!
$('#update-title').text('Flask Updated!');
$('#update-cVersion').text(pjson.version);
$('#update-rVersion').text(pjson.version);
$('#update-date').text(release.published_at.substring(0, 10));
$('#update-changelog').html(marked(release.body));
$('#update-changelog > h2').remove();
$('#download-btn').hide();
$('#update-link').text('Updated to v' + pjson.version + '!');
$('#build-type').hide();
$('#download-btn').hide();
$('#update-modal-footer a').text('Okay');

$('#update-modal').modal('open');
versionUpdates();
settingsInfo.utility.pVersion = pjson.version;
//storage.storeObj("settings", settingsInfo);
storage.saveShow();
$('#update-modal').modal('open');
versionUpdates();
settingsInfo.utility.pVersion = pjson.version;
//storage.storeObj("settings", settingsInfo);
storage.saveShow();
}
}
}
});
Expand Down

0 comments on commit d9b0b6f

Please sign in to comment.