From f4c600ee965ad2d7603cda2e44fbb4c69e371934 Mon Sep 17 00:00:00 2001 From: Emma Date: Wed, 30 Oct 2024 12:29:09 -0400 Subject: [PATCH] quickly fix how releases are checked for (it is broken in the draft release) --- src/renderer/App.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/renderer/App.js b/src/renderer/App.js index a82777b21efb2..cd55aef81a6fe 100644 --- a/src/renderer/App.js +++ b/src/renderer/App.js @@ -267,16 +267,15 @@ export default defineComponent({ .then((response) => response.json()) .then((json) => { const tagName = json[0].tag_name - const tagNameParts = tagName.split('.') - 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('$', tagName) - const versionParts = packageDetails.version.split('.') - const appVersion = versionParts[versionParts.length - 1] - if (parseInt(versionNumber) > parseInt(appVersion)) { + function versionNumberGt(versionA, versionB) { + return [versionA, versionB].sort().at(-1) === versionA + } + if (versionNumberGt(json[0].name, packageDetails.version)) { this.showUpdatesBanner = true } })