Skip to content

Commit

Permalink
**Automated release 98**
Browse files Browse the repository at this point in the history
commit 42517a9
Author: Emma <[email protected]>

🧹 Clean-up update checking logic

commit 8f97ec7
Author: Emma <[email protected]>

🔀 Reverse check in update

...

**Full Changelog**: 0.18.0.97...0.18.0.98
  • Loading branch information
MarmadileManteater committed Jan 23, 2023
2 parents 7ec73a1 + 42517a9 commit 58532de
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,28 +220,21 @@ export default defineComponent({
checkForNewUpdates: function () {
if (this.checkForUpdates) {
const requestUrl = 'https://api.github.com/repos/marmadilemanteater/freetubecordova/releases?per_page=1'
// only check for an update if you are on a nightly version
if (packageDetails.version.indexOf('nightly') !== -1) {
// don't check for updates in nightly
if (packageDetails.version.indexOf('nightly') === -1) {
fetch(requestUrl)
.then((response) => response.json())
.then((json) => {
const tagName = json[0].tag_name
const tagNameParts = tagName.split('.')
let versionNumber = tagNameParts[tagNameParts.length - 1]
// if the tag is a nightly release
if (tagName.indexOf('-nightly-') !== -1) {
versionNumber = tagName.split('-nightly-')[1]
}
const versionNumber = tagNameParts[tagNameParts.length - 1]
this.updateChangelog = marked.parse(json[0].body)
this.changeLogTitle = json[0].name

const message = this.$t('Version $ is now available! Click for more details')
this.updateBannerMessage = message.replace('$', versionNumber)
const versionParts = packageDetails.version.split('.')
let appVersion = versionParts[versionParts.length - 1]
if (appVersion.indexOf('-nightly-') !== -1) {
appVersion = appVersion.split('-nightly-')[1]
}
const appVersion = versionParts[versionParts.length - 1]
if (parseInt(versionNumber) > parseInt(appVersion)) {
this.showUpdatesBanner = true
}
Expand Down

0 comments on commit 58532de

Please sign in to comment.