feat(popup): set switch checked by default

This commit is contained in:
wanhose 2021-04-11 12:47:23 +02:00
parent c514b67cd9
commit 268c671df3
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@
<label class="switch-label">
<span>Hide irritating dialogs on <strong id="host"></strong></span>
<div class="switch">
<input id="power" type="checkbox" />
<input checked="checked" id="power" type="checkbox" />
<span class="slider"></span>
</div>
</label>

View File

@ -153,7 +153,7 @@ const handleContentLoaded = async () => {
unlike.addEventListener("click", handleRate);
if (tab.location) host.innerText = tab.location.hostname.replace("www.", "");
if (state.enabled) power.setAttribute("checked", "checked");
if (!state.enabled) power.removeAttribute("checked");
};
/**