From d85502370ba2efe759fd4ca63ef0c9729bbc38c5 Mon Sep 17 00:00:00 2001 From: emahiro Date: Sat, 7 Sep 2024 17:30:04 +0900 Subject: [PATCH 1/2] fix: empty analytics env --- .env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 5d946ab46..c0ead1fa0 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ - MERMAID_DOMAIN="mermaid.live" - MERMAID_ANALYTICS_URL="https://p.mermaid.live" +MERMAID_DOMAIN="" +MERMAID_ANALYTICS_URL="" From 0e300cf73bb998a0273d3beba96447d6d45b6f14 Mon Sep 17 00:00:00 2001 From: emahiro Date: Sat, 7 Sep 2024 22:17:17 +0900 Subject: [PATCH 2/2] fix: skip analyticsURL is not set --- src/lib/util/stats.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/util/stats.ts b/src/lib/util/stats.ts index 8ec4e3a16..bf560d8ba 100644 --- a/src/lib/util/stats.ts +++ b/src/lib/util/stats.ts @@ -4,6 +4,10 @@ import { env } from './env'; export let plausible: ReturnType | undefined; export const initAnalytics = async (): Promise => { + if (env.analyticsUrl.length === 0) { + return; + } + if (browser && !plausible) { try { const { default: Plausible } = await import('plausible-tracker');