Skip to content

Commit

Permalink
fix: Handle error in autofill
Browse files Browse the repository at this point in the history
  • Loading branch information
lscambo13 committed Jan 11, 2024
1 parent e089285 commit 52f63e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js_modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
import {
EXT_SEARCH_DOMAIN,
GOOGLE_SEARCH_DOMAIN,
SAMPLE_AUTOFILL,
} from './constants.js';
import {
cliCheck,
Expand Down Expand Up @@ -102,6 +103,9 @@ export function switchToCLI(event) {
};
const autocompleteDatabase =
JSON.parse(localStorage.getItem('autocompleteDatabase'));
if (!autocompleteDatabase) {
localStorage.setItem('autocompleteDatabase', SAMPLE_AUTOFILL);
}
const filter = autocompleteDatabase.filter((e) => {
return e.startsWith(event.target.value);
});
Expand Down

0 comments on commit 52f63e8

Please sign in to comment.