mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
Lazy Loading fuse-worker and fixed some potential timing issues when it's slow. Also keep last result while typing.
(cherry picked from commit 1e98002b8f3b01e41bff011644a9345c37c259c1)
This commit is contained in:
@@ -47,7 +47,7 @@ function getSuggestions(authors, value) {
|
||||
return suggestions;
|
||||
}
|
||||
|
||||
self.addEventListener('message', (e) => {
|
||||
onmessage = function(e) {
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
@@ -57,5 +57,12 @@ self.addEventListener('message', (e) => {
|
||||
value
|
||||
} = e.data;
|
||||
|
||||
self.postMessage(getSuggestions(authors, value));
|
||||
});
|
||||
const suggestions = getSuggestions(authors, value);
|
||||
|
||||
const results = {
|
||||
value,
|
||||
suggestions
|
||||
};
|
||||
|
||||
self.postMessage(results);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user