diff --git a/src/routes/[tag]/[slug].svelte b/src/routes/[tag]/[slug].svelte index a3bcf8e..c0fec3f 100644 --- a/src/routes/[tag]/[slug].svelte +++ b/src/routes/[tag]/[slug].svelte @@ -46,18 +46,14 @@ import { browser } from '$app/env'; import PostSeo from '$lib/components/SEO/PostSEO.svelte'; import { onMount } from 'svelte'; + import { afterNavigate } from '$app/navigation'; export let post: any; export let prevPost: any; export let nextPost: any; export let relatedPost: any[]; - $: if (post) { - if (browser) { - fitvids(); - } - } - onMount(() => { + afterNavigate(() => { if (browser) { fitvids(); }