mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-30 14:34:27 +02:00
web/layout: load the plausible script only once
oops
This commit is contained in:
parent
3295032882
commit
a8bffc4b27
@ -36,6 +36,7 @@
|
|||||||
device.prefers.reducedTransparency;
|
device.prefers.reducedTransparency;
|
||||||
|
|
||||||
$: preloadMeowbalt = false;
|
$: preloadMeowbalt = false;
|
||||||
|
$: plausibleLoaded = false;
|
||||||
|
|
||||||
afterNavigate(async () => {
|
afterNavigate(async () => {
|
||||||
const to_focus: HTMLElement | null =
|
const to_focus: HTMLElement | null =
|
||||||
@ -67,10 +68,13 @@
|
|||||||
<meta name="theme-color" content={statusBarColors[$currentTheme]} />
|
<meta name="theme-color" content={statusBarColors[$currentTheme]} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if browser && env.PLAUSIBLE_ENABLED && !$settings.privacy.disableAnalytics}
|
{#if plausibleLoaded || (browser && env.PLAUSIBLE_ENABLED && !$settings.privacy.disableAnalytics)}
|
||||||
<script
|
<script
|
||||||
defer
|
defer
|
||||||
data-domain={env.HOST}
|
data-domain={env.HOST}
|
||||||
|
on:load={() => {
|
||||||
|
plausibleLoaded = true;
|
||||||
|
}}
|
||||||
src="https://{env.PLAUSIBLE_HOST}/js/script.js"
|
src="https://{env.PLAUSIBLE_HOST}/js/script.js"
|
||||||
>
|
>
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user