mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 03:47:49 +01:00
refac: placeholder performance
This commit is contained in:
@@ -42,6 +42,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getFilteredPrompts = (inputValue) => {
|
const getFilteredPrompts = (inputValue) => {
|
||||||
|
if (inputValue.length > 500) {
|
||||||
|
filteredPrompts = [];
|
||||||
|
} else {
|
||||||
const newFilteredPrompts = inputValue.trim()
|
const newFilteredPrompts = inputValue.trim()
|
||||||
? fuse.search(inputValue.trim()).map((result) => result.item)
|
? fuse.search(inputValue.trim()).map((result) => result.item)
|
||||||
: sortedPrompts;
|
: sortedPrompts;
|
||||||
@@ -51,6 +54,7 @@
|
|||||||
if (!arraysEqual(filteredPrompts, newFilteredPrompts)) {
|
if (!arraysEqual(filteredPrompts, newFilteredPrompts)) {
|
||||||
filteredPrompts = newFilteredPrompts;
|
filteredPrompts = newFilteredPrompts;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$: if (suggestionPrompts) {
|
$: if (suggestionPrompts) {
|
||||||
|
|||||||
Reference in New Issue
Block a user