Skip to content

Commit

Permalink
增加明暗模式切换选择器的判断,防止评论区无法渲染
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjing-xin committed Jul 8, 2024
1 parent bab4c74 commit 94e1217
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/xin/wenjing/halo/artalk/ArtalkComment.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ function initArtalk(){
}
});
const targetNode = document.querySelector('[${dataTheme}]');
const config = { attributes: true, childList: false, subtree: false };
observer.observe(targetNode, config);
if(targetNode){
const config = { attributes: true, childList: false, subtree: false };
observer.observe(targetNode, config);
}
})
}
}
Expand Down

0 comments on commit 94e1217

Please sign in to comment.