Skip to content

Commit f973e7d

Browse files
authored
Merge pull request #545 from Kyle-Ye/bugfix/dock
Fix broken DockProgress Bar
2 parents 4a4b469 + 33dc634 commit f973e7d

3 files changed

Lines changed: 18 additions & 12 deletions

File tree

Xcodes.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@
15291529
repositoryURL = "https://github.com/sindresorhus/DockProgress";
15301530
requirement = {
15311531
kind = upToNextMinorVersion;
1532-
minimumVersion = 3.2.0;
1532+
minimumVersion = 4.3.1;
15331533
};
15341534
};
15351535
E84E4F552B335094003F3959 /* XCRemoteSwiftPackageReference "swift-collections" */ = {

Xcodes.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Xcodes/Backend/AppState+Install.swift

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ extension AppState {
227227
self.error = error
228228
self.presentedAlert = .generic(title: localizeString("Alert.InstallArchive.Error.Title"), message: error.legibleLocalizedDescription)
229229
}
230+
resetDockProgressTracking()
230231
})
231232
.catch { _ in
232233
Just(installedXcode)
@@ -473,19 +474,24 @@ extension AppState {
473474
// MARK: - Dock Progress Tracking
474475

475476
private func setupDockProgress() {
476-
DockProgress.progressInstance = nil
477-
DockProgress.style = .bar
478-
479-
let progress = Progress(totalUnitCount: AppState.totalProgressUnits)
480-
progress.kind = .file
481-
progress.fileOperationKind = .downloading
482-
overallProgress = progress
477+
Task { @MainActor in
478+
DockProgress.progressInstance = nil
479+
DockProgress.style = .bar
480+
481+
let progress = Progress(totalUnitCount: AppState.totalProgressUnits)
482+
progress.kind = .file
483+
progress.fileOperationKind = .downloading
484+
overallProgress = progress
485+
486+
DockProgress.progressInstance = overallProgress
487+
}
483488

484-
DockProgress.progressInstance = overallProgress
485489
}
486490

487491
func resetDockProgressTracking() {
488-
DockProgress.progress = 1 // Only way to completely remove overlay with DockProgress is setting progress to complete
492+
Task { @MainActor in
493+
DockProgress.progress = 1 // Only way to completely remove overlay with DockProgress is setting progress to complete
494+
}
489495
}
490496

491497
// MARK: -

0 commit comments

Comments
 (0)