Skip to content

Commit 348c898

Browse files
committed
Fix broken DockProgress Bar
Update DockProgress and adopt the new Concurrency Model
1 parent 21c26c9 commit 348c898

3 files changed

Lines changed: 17 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: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -473,19 +473,24 @@ extension AppState {
473473
// MARK: - Dock Progress Tracking
474474

475475
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
476+
Task { @MainActor in
477+
DockProgress.progressInstance = nil
478+
DockProgress.style = .bar
479+
480+
let progress = Progress(totalUnitCount: AppState.totalProgressUnits)
481+
progress.kind = .file
482+
progress.fileOperationKind = .downloading
483+
overallProgress = progress
484+
485+
DockProgress.progressInstance = overallProgress
486+
}
483487

484-
DockProgress.progressInstance = overallProgress
485488
}
486489

487490
func resetDockProgressTracking() {
488-
DockProgress.progress = 1 // Only way to completely remove overlay with DockProgress is setting progress to complete
491+
Task { @MainActor in
492+
DockProgress.progress = 1 // Only way to completely remove overlay with DockProgress is setting progress to complete
493+
}
489494
}
490495

491496
// MARK: -

0 commit comments

Comments
 (0)