Fix utterances theme check

This commit is contained in:
Dave Gallant
2024-01-22 19:36:25 -05:00
parent a56eeeb528
commit 8f0cec9739

View File

@@ -6,12 +6,15 @@
<script>
// load comments
var getTheme =
(localStorage && localStorage.getItem("theme")) ||
(window.matchMedia &&
window.matchMedia("(prefers-color-scheme: light)").matches)
? "light"
: "dark";
var getTheme = localStorage && localStorage.getItem("theme");
getTheme =
getTheme == null
? window.matchMedia &&
window.matchMedia("(prefers-color-scheme: light)").matches
? "light"
: "dark"
: getTheme;
getTheme = getTheme == null ? "dark" : getTheme;
let theme = getTheme === "dark" ? "gruvbox-dark" : "github-light";