diff options
author | 0neGal <mail@0negal.com> | 2023-01-29 00:30:13 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-01-29 00:30:13 +0100 |
commit | b4615926e88562461aad1a94520919a48de934e9 (patch) | |
tree | f3ecd4b10c4828834f4379f4d410d7ae25919307 /src/app/js/browser.js | |
parent | 542186aad67a59d54c973c8fad625ac4f7285016 (diff) | |
download | Viper-b4615926e88562461aad1a94520919a48de934e9.tar.gz Viper-b4615926e88562461aad1a94520919a48de934e9.zip |
simplify and fix checking package versions
Previously some outdated packages would just say "Re-Install" and not
"Update", now that's fixed, along with making the logic easier for use
in the mod list.
Diffstat (limited to 'src/app/js/browser.js')
-rw-r--r-- | src/app/js/browser.js | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/app/js/browser.js b/src/app/js/browser.js index cfd0c03..fcb79a2 100644 --- a/src/app/js/browser.js +++ b/src/app/js/browser.js @@ -328,12 +328,8 @@ function BrowserEl(properties) { if (normalized_mods.includes(normalize(properties.title))) { installstr = lang("gui.browser.reinstall"); - for (let i = 0; i < modsobj.all.length; i++) { - if (normalize(modsobj.all[i].Name) == normalize(properties.title) - && "v" + modsobj.all[i].Version != properties.version) { - - installstr = lang("gui.browser.update"); - } + if (version.is_newer(properties.version, modsobj.all[i].Version)) { + installstr = lang("gui.browser.update"); } } else { for (let i = 0; i < modsobj.all.length; i++) { @@ -347,9 +343,7 @@ function BrowserEl(properties) { if (title.includes(folder) || title.includes(manifestname)) { installstr = lang("gui.browser.reinstall"); - if (folder == title - && "v" + modsobj.all[i].Version != properties.version) { - + if (version.is_newer(properties.version, modsobj.all[i].Version)) { installstr = lang("gui.browser.update"); } } |