Skip to content

Commit

Permalink
fix theme switch
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengchun committed Dec 1, 2023
1 parent add32d1 commit 544db4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
}
// home components preview
const btnSwitchColorMode = document.querySelector(`input[name="btnColorMode"][value="${theme}"]`);
if (typeof btnSwitchColorMode === 'object') {
if (btnSwitchColorMode && typeof btnSwitchColorMode === 'object') {
btnSwitchColorMode.checked = true;
}
};
Expand Down

0 comments on commit 544db4e

Please sign in to comment.