From 268c671df371c93455b835a642e4b822f931ece7 Mon Sep 17 00:00:00 2001 From: wanhose Date: Sun, 11 Apr 2021 12:47:23 +0200 Subject: [PATCH] feat(popup): set switch checked by default --- popup.html | 2 +- scripts/popup.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/popup.html b/popup.html index 5ed9fe1..9b1a9dc 100644 --- a/popup.html +++ b/popup.html @@ -36,7 +36,7 @@ diff --git a/scripts/popup.js b/scripts/popup.js index b6ebffe..4ce43e0 100644 --- a/scripts/popup.js +++ b/scripts/popup.js @@ -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"); }; /**