mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 09:28:29 +00:00
web/layout: load the plausible script only once
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Run tests / check lockfile correctness (push) Has been cancelled
Run tests / web sanity check (push) Has been cancelled
Run tests / api sanity check (push) Has been cancelled
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Run tests / check lockfile correctness (push) Has been cancelled
Run tests / web sanity check (push) Has been cancelled
Run tests / api sanity check (push) Has been cancelled
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…
Reference in New Issue
Block a user