refactor: Simplify tests and comply with StandardJS style (#5026)

* refactor: Simplify tests and comply with StandardJS style

Use === instead of ==, except where it's used to match both null and
undefined.

* style: further tweaks
This commit is contained in:
Jennifer Richards 2023-01-25 17:09:13 -04:00 committed by GitHub
parent 61f7984d5c
commit 040af97c11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,8 +62,7 @@ document.addEventListener("DOMContentLoaded", function (event) {
const val = in_localStorage.includes(btn.name) ?
localStorage.getItem(btn.name) : cookies.get(btn.name);
if (val == id || ((val == undefined || val == null) &&
btn_pref[btn.name] == id)) {
if (val === id || (val === null && btn_pref[btn.name] === id)) {
btn.checked = true;
}