Skip to content

Commit

Permalink
Fix broken DockProgress Bar
Browse files Browse the repository at this point in the history
Update DockProgress and adopt the new Concurrency Model
  • Loading branch information
Kyle-Ye committed Mar 30, 2024
1 parent 21c26c9 commit 348c898
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Xcodes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@
repositoryURL = "https://github.com/sindresorhus/DockProgress";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 3.2.0;
minimumVersion = 4.3.1;
};
};
E84E4F552B335094003F3959 /* XCRemoteSwiftPackageReference "swift-collections" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/sindresorhus/DockProgress",
"state": {
"branch": null,
"revision": "7100b68571e2dafe3a06ad5905b80fc3b0107b4b",
"version": "3.2.0"
"revision": "d4f23b5a8f5ca0fac393eb7ba78c2fe3e32e52da",
"version": "4.3.1"
}
},
{
Expand Down
23 changes: 14 additions & 9 deletions Xcodes/Backend/AppState+Install.swift
Original file line number Diff line number Diff line change
Expand Up @@ -473,19 +473,24 @@ extension AppState {
// MARK: - Dock Progress Tracking

private func setupDockProgress() {
DockProgress.progressInstance = nil
DockProgress.style = .bar

let progress = Progress(totalUnitCount: AppState.totalProgressUnits)
progress.kind = .file
progress.fileOperationKind = .downloading
overallProgress = progress
Task { @MainActor in
DockProgress.progressInstance = nil
DockProgress.style = .bar

let progress = Progress(totalUnitCount: AppState.totalProgressUnits)
progress.kind = .file
progress.fileOperationKind = .downloading
overallProgress = progress

DockProgress.progressInstance = overallProgress
}

DockProgress.progressInstance = overallProgress
}

func resetDockProgressTracking() {
DockProgress.progress = 1 // Only way to completely remove overlay with DockProgress is setting progress to complete
Task { @MainActor in
DockProgress.progress = 1 // Only way to completely remove overlay with DockProgress is setting progress to complete
}
}

// MARK: -
Expand Down

0 comments on commit 348c898

Please sign in to comment.