fix: check if DISQUS is loaded before accessing it (#626)

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/571
This commit is contained in:
Jimmy Cai 2022-06-09 22:43:08 +02:00 committed by GitHub
parent 49c0a2bc56
commit 01eb9a4b0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,7 @@
<script>
window.addEventListener('onColorSchemeChange', (e) => {
if (DISQUS) {
if (typeof DISQUS == 'object') {
DISQUS.reset({
reload: true
});