[#762] Update UI for the right architecture when tapping on install by damien-rivet · Pull Request #765 · XcodesOrg/XcodesApp · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Xcodes/Backend/AppState+Install.swift
2 changes: 1 addition & 1 deletion Xcodes/Backend/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ class AppState: ObservableObject {
installationPublishers[id] = signInIfNeeded()
.handleEvents(
receiveSubscription: { [unowned self] _ in
self.setInstallationStep(of: availableXcode.version, to: .authenticating)
self.setInstallationStep(of: availableXcode, to: .authenticating)
}
)
.flatMap { [unowned self] in
Expand Down
5 changes: 5 additions & 0 deletions Xcodes/Backend/Xcode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public struct XcodeID: Codable, Hashable, Identifiable {
self.version = version
self.architectures = architectures
}

public static func == (lhs: Self, rhs: Self) -> Bool {
// First compare versions (using only semVer components) then compare architectures
lhs.version.isEquivalent(to: rhs.version) && lhs.architectures == rhs.architectures
}
}

struct Xcode: Identifiable, CustomStringConvertible {
Expand Down
8 changes: 4 additions & 4 deletions XcodesTests/AppStateTests.swift