diff --git a/src/renderer/App.js b/src/renderer/App.js index c05bf89cef89a..28637e1831f57 100644 --- a/src/renderer/App.js +++ b/src/renderer/App.js @@ -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 }