Removes unnecessary StoreApp convenience properties as well as fix other issues

This commit is contained in:
nythepegasus
2024-05-09 01:57:11 -04:00
committed by ny
parent 1ae8d336be
commit be5e84537a
4 changed files with 7 additions and 8 deletions

View File

@@ -32,7 +32,6 @@ final class DownloadAppOperation: ResultOperation<ALTApplication>
self.appName = app.name self.appName = app.name
self.bundleIdentifier = app.bundleIdentifier self.bundleIdentifier = app.bundleIdentifier
self.sourceURL = app.url
self.destinationURL = destinationURL self.destinationURL = destinationURL
super.init() super.init()

View File

@@ -30,7 +30,7 @@ extension VerificationError
VerificationError(code: .mismatchedBundleIdentifiers, app: app, sourceBundleID: sourceBundleID) VerificationError(code: .mismatchedBundleIdentifiers, app: app, sourceBundleID: sourceBundleID)
} }
static func iOSVersionNotSupported(app: ALTApplication, osVersion: OperatingSystemVersion = ProcessInfo.processInfo.operatingSystemVersion, requiredOSVersion: OperatingSystemVersion?) -> VerificationError { static func iOSVersionNotSupported(app: AppProtocol, osVersion: OperatingSystemVersion = ProcessInfo.processInfo.operatingSystemVersion, requiredOSVersion: OperatingSystemVersion?) -> VerificationError {
VerificationError(code: .iOSVersionNotSupported, app: app) VerificationError(code: .iOSVersionNotSupported, app: app)
} }
} }

View File

@@ -62,14 +62,14 @@ public class InstalledApp: NSManagedObject, InstalledAppProtocol
@objc public var hasUpdate: Bool { @objc public var hasUpdate: Bool {
if self.storeApp == nil { return false } if self.storeApp == nil { return false }
if self.storeApp!.latestVersion == nil { return false } if self.storeApp!.latestSupportedVersion == nil { return false }
let currentVersion = SemanticVersion(self.version) let currentVersion = SemanticVersion(self.version)
let latestVersion = SemanticVersion(self.storeApp!.latestVersion!.version) let latestVersion = SemanticVersion(self.storeApp!.latestSupportedVersion!.version)
if currentVersion == nil || latestVersion == nil { if currentVersion == nil || latestVersion == nil {
// One of the versions is not valid SemVer, fall back to comparing the version strings by character // One of the versions is not valid SemVer, fall back to comparing the version strings by character
return self.version < self.storeApp!.latestVersion!.version return self.version < self.storeApp!.latestSupportedVersion!.version
} }
return currentVersion! < latestVersion! return currentVersion! < latestVersion!