mirror of
https://github.com/open-webui/open-webui.git
synced 2026-04-28 11:38:38 -05:00
refac: dedup tags
This commit is contained in:
@@ -121,7 +121,10 @@
|
||||
if (selectedTag === '') {
|
||||
return true;
|
||||
}
|
||||
return (item.model?.tags ?? []).map((tag) => tag.name).includes(selectedTag);
|
||||
|
||||
return (item.model?.tags ?? [])
|
||||
.map((tag) => tag.name.toLowerCase())
|
||||
.includes(selectedTag.toLowerCase());
|
||||
})
|
||||
.filter((item) => {
|
||||
if (selectedConnectionType === '') {
|
||||
@@ -139,7 +142,9 @@
|
||||
if (selectedTag === '') {
|
||||
return true;
|
||||
}
|
||||
return (item.model?.tags ?? []).map((tag) => tag.name).includes(selectedTag);
|
||||
return (item.model?.tags ?? [])
|
||||
.map((tag) => tag.name.toLowerCase())
|
||||
.includes(selectedTag.toLowerCase());
|
||||
})
|
||||
.filter((item) => {
|
||||
if (selectedConnectionType === '') {
|
||||
@@ -315,7 +320,7 @@
|
||||
tags = items
|
||||
.filter((item) => !(item.model?.info?.meta?.hidden ?? false))
|
||||
.flatMap((item) => item.model?.tags ?? [])
|
||||
.map((tag) => tag.name);
|
||||
.map((tag) => tag.name.toLowerCase());
|
||||
// Remove duplicates and sort
|
||||
tags = Array.from(new Set(tags)).sort((a, b) => a.localeCompare(b));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user