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