Fixed versions comparison

This commit is contained in:
Observer KRypt0n_ 2021-10-29 09:59:13 +02:00
parent ca2f43ebf0
commit 8d1543f0ae
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
2 changed files with 6 additions and 2 deletions

View file

@ -39,6 +39,7 @@
}
},
"devDependencies": {
"@types/semver": "^7.3.9",
"@types/discord-rpc": "^4.0.0",
"electron": "^14.0.0",
"electron-builder": "^22.13.1",
@ -49,6 +50,7 @@
"cash-dom": "^8.1.0",
"discord-rpc": "^4.0.1",
"electron-store": "^8.0.1",
"follow-redirects": "^1.14.4"
"follow-redirects": "^1.14.4",
"semver": "^7.3.5"
}
}

View file

@ -3,6 +3,8 @@ const fs = require('fs');
const { exec } = require('child_process');
const { ipcRenderer } = require('electron');
const semver = require('semver');
import $ from 'cash-dom';
import { Genshinlib } from './lib/Genshinlib';
@ -100,7 +102,7 @@ $(() => {
});
Tools.getGitTags('https://notabug.org/nobody/an-anime-game-launcher').then (tags => {
if (tags.filter(entry => entry.tag > launcher_version).length > 0)
if (tags.filter(entry => semver.gt(entry.tag, launcher_version)).length > 0)
{
ipcRenderer.send('notification', {
title: `Launcher update available (${launcher_version} -> ${tags[tags.length - 1].tag})`,