mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-30 06:24:25 +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;
|
||||
|
||||
$: preloadMeowbalt = false;
|
||||
$: plausibleLoaded = false;
|
||||
|
||||
afterNavigate(async () => {
|
||||
const to_focus: HTMLElement | null =
|
||||
@ -67,10 +68,13 @@
|
||||
<meta name="theme-color" content={statusBarColors[$currentTheme]} />
|
||||
{/if}
|
||||
|
||||
{#if browser && env.PLAUSIBLE_ENABLED && !$settings.privacy.disableAnalytics}
|
||||
{#if plausibleLoaded || (browser && env.PLAUSIBLE_ENABLED && !$settings.privacy.disableAnalytics)}
|
||||
<script
|
||||
defer
|
||||
data-domain={env.HOST}
|
||||
on:load={() => {
|
||||
plausibleLoaded = true;
|
||||
}}
|
||||
src="https://{env.PLAUSIBLE_HOST}/js/script.js"
|
||||
>
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user