diff --git a/blog/static/js/edition-2/main.js b/blog/static/js/edition-2/main.js index 1ebee250..f4cb57c2 100644 --- a/blog/static/js/edition-2/main.js +++ b/blog/static/js/edition-2/main.js @@ -1,15 +1,17 @@ window.onload = function () { - let theme = localStorage.getItem("theme"); - if (theme != null) { - set_theme(theme) - } - let container = document.querySelector('#toc-aside'); if (container != null) { resize_toc(container); toc_scroll_position(container); window.onscroll = function () { toc_scroll_position(container) }; } + + let theme = localStorage.getItem("theme"); + if (theme != null) { + setTimeout(() => { + set_giscus_theme(theme) + }, 500); + } } function resize_toc(container) {