diff --git a/src/components/ArticleComments/ArticleComments.astro b/src/components/ArticleComments/ArticleComments.astro index 08dbf3b..05fee3d 100644 --- a/src/components/ArticleComments/ArticleComments.astro +++ b/src/components/ArticleComments/ArticleComments.astro @@ -20,7 +20,7 @@ import UIString from "../UIString"; $commentsScript.setAttribute("crossorigin", "anonymous"); if (window.theme) { - $commentsScript.setAttribute("theme", theme === "dark" ? "dark-blue" : "github-light"); + $commentsScript.setAttribute("theme", window.theme === "dark" ? "dark-blue" : "github-light"); } else { $commentsScript.setAttribute("theme", "github-light"); } diff --git a/src/components/ArticlePost/ArticlePost.astro b/src/components/ArticlePost/ArticlePost.astro index c1d951a..70eb567 100644 --- a/src/components/ArticlePost/ArticlePost.astro +++ b/src/components/ArticlePost/ArticlePost.astro @@ -84,6 +84,7 @@ const t = useTranslation(Astro); const views = await response.text(); const $views = document.getElementById("views"); + if (isNaN(parseInt(views, 10))) return; if ($views) $views.textContent = views; })();