Skip to content

Commit 4321803

Browse files
committed
Update toolbar.js
1 parent 83c5c8d commit 4321803

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

js/toolbar.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -617,16 +617,17 @@ class Toolbar {
617617
}
618618

619619
renderThemeSelectIcon(themeBox, themes) {
620-
const icon = document.getElementById("themeSelectIcon");
620+
const icon = docById("themeSelectIcon");
621+
if (!icon) return;
622+
621623
themes.forEach(theme => {
622624
if (localStorage.themePreference === theme) {
623-
icon.innerHTML = document.getElementById(theme).innerHTML;
625+
icon.innerHTML = docById(theme).innerHTML;
624626
}
625627
});
626-
const themeSelectIcon = docById("themeSelectIcon");
627-
const themeList = themes;
628-
themeSelectIcon.onclick = () => {
629-
themeList.forEach(theme => {
628+
629+
icon.onclick = () => {
630+
themes.forEach(theme => {
630631
docById(theme).onclick = () => themeBox[`${theme}_onclick`](this.activity);
631632
});
632633
};

0 commit comments

Comments
 (0)