From f7f8bac73e15f6cfd059eb8c1f199d29748fc898 Mon Sep 17 00:00:00 2001 From: "Jan T. Sott" Date: Sat, 30 Nov 2024 11:11:56 +0100 Subject: [PATCH 1/2] add mapping for installer types --- components/SingleApp.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/components/SingleApp.js b/components/SingleApp.js index 3c969b1..f599b4d 100644 --- a/components/SingleApp.js +++ b/components/SingleApp.js @@ -149,6 +149,27 @@ let SingleApp = ({ app, all, onVersionChange = false, large = false, showTime = window.open(link) } + const handleInstallerType = (installerType) => { + const lowercaseType = installerType.toLowerCase(); + + switch (lowercaseType) { + case "appx": + case "exe": + case "msi": + case "msix": + case "zip": + return `.${lowercaseType}` + + case "nullsoft": + case "inno": + case "portable": + return ".exe" + + case "wix": + return ".msi" + } + } + return (
  • Download{" "} {app.versions[0].installerType - ? `(.${app.versions[0].installerType.toLowerCase()})` + ? `(.${handleInstallerType(app.versions[0].installerType)})` : ""}
  • From 496d1c3cd946aa4c798f85c52cb821baee20fd9c Mon Sep 17 00:00:00 2001 From: "Jan T. Sott" Date: Sat, 30 Nov 2024 11:18:47 +0100 Subject: [PATCH 2/2] move toLowerCase() --- components/SingleApp.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/SingleApp.js b/components/SingleApp.js index f599b4d..46f7590 100644 --- a/components/SingleApp.js +++ b/components/SingleApp.js @@ -150,15 +150,13 @@ let SingleApp = ({ app, all, onVersionChange = false, large = false, showTime = } const handleInstallerType = (installerType) => { - const lowercaseType = installerType.toLowerCase(); - - switch (lowercaseType) { + switch (installerType) { case "appx": case "exe": case "msi": case "msix": case "zip": - return `.${lowercaseType}` + return `.${installerType}` case "nullsoft": case "inno": @@ -286,7 +284,7 @@ let SingleApp = ({ app, all, onVersionChange = false, large = false, showTime = Download{" "} {app.versions[0].installerType - ? `(.${handleInstallerType(app.versions[0].installerType)})` + ? `(.${handleInstallerType(app.versions[0].installerType.toLowerCase()})` : ""}