mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Merge pull request #102 from RobotsAndPencils/downloader-from-userDefaults
When downloading, use the downloader from userdefaults
This commit is contained in:
commit
e5065b4a58
2 changed files with 4 additions and 3 deletions
|
|
@ -15,7 +15,8 @@ extension AppState {
|
|||
}
|
||||
|
||||
private func install(_ installationType: InstallationType, downloader: Downloader, attemptNumber: Int) -> AnyPublisher<InstalledXcode, Error> {
|
||||
getXcodeArchive(installationType, downloader: downloader)
|
||||
Logger.appState.info("Using \(downloader) downloader")
|
||||
return getXcodeArchive(installationType, downloader: downloader)
|
||||
.flatMap { xcode, url -> AnyPublisher<InstalledXcode, Swift.Error> in
|
||||
self.installArchivedXcode(xcode, at: url)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class AppState: ObservableObject {
|
|||
|
||||
@Published var error: Error?
|
||||
@Published var authError: Error?
|
||||
|
||||
|
||||
// MARK: - Publisher Cancellables
|
||||
|
||||
var cancellables = Set<AnyCancellable>()
|
||||
|
|
@ -299,7 +299,7 @@ class AppState: ObservableObject {
|
|||
.mapError { $0 as Error }
|
||||
}
|
||||
.flatMap { [unowned self] in
|
||||
self.install(.version(availableXcode), downloader: .aria2)
|
||||
self.install(.version(availableXcode), downloader: Downloader(rawValue: UserDefaults.standard.string(forKey: "downloader") ?? "aria2") ?? .aria2)
|
||||
}
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(
|
||||
|
|
|
|||
Loading…
Reference in a new issue