From 6b84e497d95f5efefc0ad0f91c5bc33c5037d6f9 Mon Sep 17 00:00:00 2001 From: FauconSpartiate <49079695+FauconSpartiate@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:30:38 +0200 Subject: [PATCH 1/2] Correctly handle versions with extension --- .../HaystackApp/UpdateCheckController.swift | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/OpenHaystack/OpenHaystack/HaystackApp/UpdateCheckController.swift b/OpenHaystack/OpenHaystack/HaystackApp/UpdateCheckController.swift index 0368c0c..8c10519 100644 --- a/OpenHaystack/OpenHaystack/HaystackApp/UpdateCheckController.swift +++ b/OpenHaystack/OpenHaystack/HaystackApp/UpdateCheckController.swift @@ -90,8 +90,19 @@ public struct UpdateCheckController { /// - installedVersion: The currently installed version /// - Returns: .older when a newer version is available. .newer when the installed version is newer .same, if both versions are equal internal static func compareVersions(availableVersion: String, installedVersion: String) -> VersionCompare { - let availableVersionSplit = availableVersion.split(separator: ".") - let installedVersionSplit = installedVersion.split(separator: ".") + // Handle dash extensions + var availableVersionTrim = availableVersion + var installedVersionTrim = installedVersion + + if let dashIndex = availablePart.firstIndex(of: "-") { + availablePart = availablePart[.. Date: Fri, 30 Jun 2023 14:13:50 +0200 Subject: [PATCH 2/2] How the hell did this happen? --- .../OpenHaystack/HaystackApp/UpdateCheckController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenHaystack/OpenHaystack/HaystackApp/UpdateCheckController.swift b/OpenHaystack/OpenHaystack/HaystackApp/UpdateCheckController.swift index 8c10519..f136909 100644 --- a/OpenHaystack/OpenHaystack/HaystackApp/UpdateCheckController.swift +++ b/OpenHaystack/OpenHaystack/HaystackApp/UpdateCheckController.swift @@ -94,11 +94,11 @@ public struct UpdateCheckController { var availableVersionTrim = availableVersion var installedVersionTrim = installedVersion - if let dashIndex = availablePart.firstIndex(of: "-") { - availablePart = availablePart[..