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.main
parent
cab1105169
commit
a6a97aa9c7
|
@ -25,7 +25,12 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
localStorage.advSearchToggled = on;
|
localStorage.advSearchToggled = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
toggleAdvancedSearch(JSON.parse(localStorage.advSearchToggled));
|
toggleAdvancedSearch(JSON.parse(localStorage.advSearchToggled));
|
||||||
|
} catch (error) {
|
||||||
|
console.warn("Did not recover advanced search toggle state");
|
||||||
|
}
|
||||||
|
|
||||||
advSearchToggle.onclick = () => {
|
advSearchToggle.onclick = () => {
|
||||||
toggleAdvancedSearch(advSearchToggle.checked);
|
toggleAdvancedSearch(advSearchToggle.checked);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue