Sort versions by semver

This commit is contained in:
Nindi Gill 2023-05-24 14:38:07 +10:00
parent 8a4fb34f77
commit 6c7ba4cb65
No known key found for this signature in database
GPG key ID: FF9A7FD590D4F4B1

View file

@ -153,7 +153,11 @@ struct RefreshView: View {
} }
} }
installers.sort { $0.version == $1.version ? ($0.build.count == $1.build.count ? $0.build > $1.build : $0.build.count > $1.build.count) : $0.version > $1.version } installers.sort {
$0.version == $1.version ?
($0.build.count == $1.build.count ? $0.build > $1.build : $0.build.count > $1.build.count) :
$0.version.compare($1.version, options: .numeric) == .orderedDescending
}
guard !installers.isEmpty else { guard !installers.isEmpty else {
throw MistError.invalidData throw MistError.invalidData