fix(ui): narrow services type for Inspector live-add picker
ObservedNode.services is the literal tuple ['*']; narrowing inside the .filter() callback was tripping TS2345. We already gate the live controls on node.kind !== 'observed', so casting to readonly string[] inside the filter is safe and keeps the discriminated union strict elsewhere.
This commit is contained in:
@@ -184,7 +184,7 @@ const Inspector: React.FC<Props> = ({
|
||||
>
|
||||
<option value="">— pick a service —</option>
|
||||
{availableServices
|
||||
.filter((s) => !node.services.includes(s))
|
||||
.filter((s) => !(node.services as readonly string[]).includes(s))
|
||||
.map((s) => (
|
||||
<option key={s} value={s}>{s}</option>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user