EditChannel.js
44.6 KB
-
🐛 fix(channel): remove duplicate model names in “Edit Channel” model dropdown (#1292) · 949d4625• Unify the Select option structure as `{ key, label, value }`; add missing `key` to prevent duplicated rendering by Semi-UI. • Trim and deduplicate the `models` array via `Set` inside `handleInputChange`, ensuring state always contains unique values. • In the options-merging `useEffect`, use a `Map` keyed by `value` (after `trim`) to guarantee a unique `optionList` when combining backend data with currently selected models. • Apply the same structure and de-duplication when: – Fetching models from `/api/channel/models` – Adding custom models (`addCustomModels`) – Fetching upstream model lists (`fetchUpstreamModelList`) • Replace obsolete `text` field with `label` in custom option objects for consistency. No backend changes are required; the fix is entirely front-end. Closes #1292t0ng7u committed