|
@@ -42,14 +42,18 @@
|
|
}
|
|
}
|
|
|
|
|
|
const getFilteredPrompts = (inputValue) => {
|
|
const getFilteredPrompts = (inputValue) => {
|
|
- 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;
|
|
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|