@@ -20,9 +20,11 @@ struct UpdateSomePackagesView: View
2020
2121 @State private var packageUpdatingErrors : [ String ] = . init( )
2222
23- var selectedPackages : [ OutdatedPackage ]
23+ let packagesToUpdate : [ OutdatedPackage ]
24+
25+ var numberOfPackagesToUpdate : Int
2426 {
25- return outdatedPackageTracker . displayableOutdatedPackages . filter { $0 . isMarkedForUpdating }
27+ packagesToUpdate . count
2628 }
2729
2830 var body : some View
@@ -32,14 +34,14 @@ struct UpdateSomePackagesView: View
3234 switch packageUpdatingStage
3335 {
3436 case . updating:
35- ProgressView ( value: updateProgress, total: Double ( selectedPackages . count) )
37+ ProgressView ( value: updateProgress, total: Double ( packagesToUpdate . count) )
3638 {
3739 Text ( " update-packages.incremental.update-in-progress- \( packageBeingCurrentlyUpdated. name) " )
3840 }
3941 . frame ( width: 200 )
4042 . task
4143 {
42- for (index, outdatedPackage) in selectedPackages . enumerated ( )
44+ for (index, outdatedPackage) in packagesToUpdate . enumerated ( )
4345 {
4446 packageBeingCurrentlyUpdated = outdatedPackage. package
4547
@@ -62,11 +64,11 @@ struct UpdateSomePackagesView: View
6264 {
6365 case . standardOutput( let outputLine) :
6466 AppConstants . shared. logger. info ( " Individual package updating output: \( outputLine) " )
65- updateProgress = updateProgress + ( Double ( selectedPackages . count ) / 100 )
67+ updateProgress = updateProgress + ( Double ( numberOfPackagesToUpdate ) / 100 )
6668
6769 case . standardError( let errorLine) :
6870 AppConstants . shared. logger. info ( " Individual package updating error: \( errorLine) " )
69- updateProgress = updateProgress + ( Double ( selectedPackages . count ) / 100 )
71+ updateProgress = updateProgress + ( Double ( numberOfPackagesToUpdate ) / 100 )
7072
7173 if !errorLine. contains ( " The post-install step did not complete successfully " )
7274 {
0 commit comments