diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 003fbec8..27603498 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -33,7 +33,7 @@

Comments

loadUtterances(isDarkMode); // Watch for theme changes -const observer = new MutationObserver((mutations) => { +const themeObserver = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === 'attributes' && mutation.attributeName === 'class') { const isDarkMode = getCurrentTheme() === 'dark'; @@ -44,7 +44,7 @@

Comments

}); // Start observing the body element for class changes -observer.observe(document.body, { +themeObserver.observe(document.body, { attributes: true, attributeFilter: ['class'] });