mirror of
https://github.com/open-webui/open-webui
synced 2025-02-22 21:32:32 +00:00
refac: placeholder performance
This commit is contained in:
parent
fa92abce31
commit
d9ee53b504
@ -42,14 +42,18 @@
|
||||
}
|
||||
|
||||
const getFilteredPrompts = (inputValue) => {
|
||||
const newFilteredPrompts = inputValue.trim()
|
||||
? fuse.search(inputValue.trim()).map((result) => result.item)
|
||||
: sortedPrompts;
|
||||
if (inputValue.length > 500) {
|
||||
filteredPrompts = [];
|
||||
} else {
|
||||
const newFilteredPrompts = inputValue.trim()
|
||||
? fuse.search(inputValue.trim()).map((result) => result.item)
|
||||
: sortedPrompts;
|
||||
|
||||
// Compare with the oldFilteredPrompts
|
||||
// If there's a difference, update array + version
|
||||
if (!arraysEqual(filteredPrompts, newFilteredPrompts)) {
|
||||
filteredPrompts = newFilteredPrompts;
|
||||
// Compare with the oldFilteredPrompts
|
||||
// If there's a difference, update array + version
|
||||
if (!arraysEqual(filteredPrompts, newFilteredPrompts)) {
|
||||
filteredPrompts = newFilteredPrompts;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user