mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
When downloading, use the downloader from userdefaults
This commit is contained in:
parent
c082fa279b
commit
c6e3382d94
3 changed files with 5 additions and 4 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") ?? "urlSession") ?? .urlSession)
|
||||
}
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{\rtf1\ansi\ansicpg1252\cocoartf2577
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf2578
|
||||
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 .SFNS-Regular;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\expandedcolortbl;;}
|
||||
|
|
|
|||
Loading…
Reference in a new issue