mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
refac
This commit is contained in:
parent
73f8237d43
commit
b0279c5090
1 changed files with 25 additions and 4 deletions
|
|
@ -130,7 +130,14 @@
|
||||||
name: 'false',
|
name: 'false',
|
||||||
type: 'pinned'
|
type: 'pinned'
|
||||||
}
|
}
|
||||||
];
|
].filter((item) => {
|
||||||
|
const pinnedValue = lastWord.slice(7);
|
||||||
|
if (pinnedValue) {
|
||||||
|
return item.id.startsWith(pinnedValue) && item.id !== pinnedValue;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (lastWord.startsWith('shared:')) {
|
} else if (lastWord.startsWith('shared:')) {
|
||||||
filteredItems = [
|
filteredItems = [
|
||||||
{
|
{
|
||||||
|
|
@ -143,7 +150,14 @@
|
||||||
name: 'false',
|
name: 'false',
|
||||||
type: 'shared'
|
type: 'shared'
|
||||||
}
|
}
|
||||||
];
|
].filter((item) => {
|
||||||
|
const sharedValue = lastWord.slice(7);
|
||||||
|
if (sharedValue) {
|
||||||
|
return item.id.startsWith(sharedValue) && item.id !== sharedValue;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (lastWord.startsWith('archived:')) {
|
} else if (lastWord.startsWith('archived:')) {
|
||||||
filteredItems = [
|
filteredItems = [
|
||||||
{
|
{
|
||||||
|
|
@ -156,7 +170,14 @@
|
||||||
name: 'false',
|
name: 'false',
|
||||||
type: 'archived'
|
type: 'archived'
|
||||||
}
|
}
|
||||||
];
|
].filter((item) => {
|
||||||
|
const archivedValue = lastWord.slice(9);
|
||||||
|
if (archivedValue) {
|
||||||
|
return item.id.startsWith(archivedValue) && item.id !== archivedValue;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
filteredItems = [];
|
filteredItems = [];
|
||||||
}
|
}
|
||||||
|
|
@ -297,7 +318,7 @@
|
||||||
const words = value.split(' ');
|
const words = value.split(' ');
|
||||||
|
|
||||||
words.pop();
|
words.pop();
|
||||||
words.push(`${item.type}:${item.id}`);
|
words.push(`${item.type}:${item.id} `);
|
||||||
|
|
||||||
value = words.join(' ');
|
value = words.join(' ');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue