fix: finish progressive Target detection
This commit is contained in:
@@ -20,10 +20,14 @@ type targetCatalog struct {
|
||||
items []app.TargetSnapshot
|
||||
}
|
||||
|
||||
func newTargetCatalog(snapshot app.Snapshot, includeUnavailable bool) targetCatalog {
|
||||
func newTargetCatalog(snapshot app.Snapshot, includeUnavailable bool, selectedID string) targetCatalog {
|
||||
items := make([]app.TargetSnapshot, 0, len(snapshot.Targets))
|
||||
for _, item := range snapshot.Targets {
|
||||
if item.Available || includeUnavailable || item.DetectionPhase != app.TargetReady {
|
||||
// Available Targets are the routine default. If progressive detection
|
||||
// proves the selected identity unavailable, keep that one row visible
|
||||
// until the user selects another Target rather than silently moving the
|
||||
// selection to a different product.
|
||||
if item.Available || includeUnavailable || item.ID == selectedID || item.DetectionPhase != app.TargetReady {
|
||||
items = append(items, item)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user