Skip to content

Commit 253d378

Browse files
committed
Fix redeclaration problem of observer variable.
1 parent a8038d0 commit 253d378

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

layouts/partials/comments.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2>Comments</h2>
3333
loadUtterances(isDarkMode);
3434

3535
// Watch for theme changes
36-
const observer = new MutationObserver((mutations) => {
36+
const themeObserver = new MutationObserver((mutations) => {
3737
mutations.forEach((mutation) => {
3838
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
3939
const isDarkMode = getCurrentTheme() === 'dark';
@@ -44,7 +44,7 @@ <h2>Comments</h2>
4444
});
4545

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

0 commit comments

Comments
 (0)