mirror of
https://github.com/benbusby/whoogle-search.git
synced 2026-03-11 08:54:34 +00:00
Catch failure to restore adv search state
Shouldn't throw any errors if this fails to be restored from local storage for any reason. It's purely a nice-to-have feature.
This commit is contained in:
parent
cab1105169
commit
a6a97aa9c7
1 changed files with 6 additions and 1 deletions
|
|
@ -25,7 +25,12 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
localStorage.advSearchToggled = on;
|
||||
}
|
||||
|
||||
toggleAdvancedSearch(JSON.parse(localStorage.advSearchToggled));
|
||||
try {
|
||||
toggleAdvancedSearch(JSON.parse(localStorage.advSearchToggled));
|
||||
} catch (error) {
|
||||
console.warn("Did not recover advanced search toggle state");
|
||||
}
|
||||
|
||||
advSearchToggle.onclick = () => {
|
||||
toggleAdvancedSearch(advSearchToggle.checked);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue