mirror of https://github.com/buresdv/Cork
+ WIP reversion of list selection to UUID
This commit is contained in:
parent
b6c3411d92
commit
f44781b75a
|
|
@ -12,6 +12,7 @@ import CorkShared
|
|||
protocol PackageTrackable: ObservableObject, Sendable
|
||||
{
|
||||
func processRawPackageArray(trackingArray: [BrewPackage]) async -> [BrewPackage]
|
||||
func findPackageInTrackerByUUID(packageToFind: BrewPackage) -> BrewPackage?
|
||||
}
|
||||
|
||||
extension PackageTrackable
|
||||
|
|
@ -60,3 +61,18 @@ extension PackageTrackable
|
|||
return tempArray
|
||||
}
|
||||
}
|
||||
|
||||
extension PackageTrackable
|
||||
{
|
||||
/// Find a package in the tracking array by its UUID
|
||||
/// The result is the found package in the tracking array
|
||||
func findPackageInTrackerByUUID(trackingArray: [BrewPackage], uuidToFind: UUID) -> BrewPackage?
|
||||
{
|
||||
guard let foundPackage = trackingArray.first(where: { $0.id == uuidToFind }) else
|
||||
{
|
||||
return nil
|
||||
}
|
||||
|
||||
return foundPackage
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ struct SearchResultRow: View, Sendable
|
|||
}
|
||||
}
|
||||
}
|
||||
.tag(AddFormulaView.PackageSelectedToBeInstalled(package: searchedForPackage, version: selectedVersion.isEmpty ? nil : selectedVersion))
|
||||
.tag(searchedForPackage.id)
|
||||
.task
|
||||
{
|
||||
if showDescriptionsInSearchResults
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ struct InstallationInitialView: View
|
|||
|
||||
@Binding var packageRequested: String
|
||||
|
||||
@Binding var foundPackageSelection: AddFormulaView.PackageSelectedToBeInstalled?
|
||||
@Binding var foundPackageSelection: UUID?
|
||||
|
||||
@ObservedObject var installationProgressTracker: InstallationProgressTracker
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue