ui: fix language select

This commit is contained in:
undefined committed 2025-08-03 20:52:51 +08:00
1 parent f0c895e5c5
commit 8df1e3ae5e
1 file changed
+1 -1
@@ -15,7 +15,7 @@ const LanguageSelectAutoComplete = React.forwardRef<any, any>((props, ref) => (
renderItem={(item) => (prefixes.has(item._id) ? '' : `${item.name}`)}
onChange={(val) => {
let value = val.split(',');
const active = new Set(value.filter((i) => i.includes('.')).map((i) => i.split('.')[0]));
const active = new Set(value.filter((i) => i.includes('.').map((i) => i.split('.')[0])));
value = value.filter((i) => !prefixes.has(i) || active.has(i));
for (const i of active) if (!value.includes(i)) value.push(i);
props.onChange(value.join(','));