From 3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 8 Feb 2023 10:13:03 -0800 Subject: rm uuid route --- src/lib/utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/utils.js') diff --git a/src/lib/utils.js b/src/lib/utils.js index 24991100..ef1e997b 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -4,9 +4,13 @@ import { browser } from '$app/environment'; import { toast } from '@zerodevx/svelte-toast'; import { goto } from '$app/navigation'; import { PUBLIC_COINOS_URL } from '$env/static/public'; +import { page } from '$app/stores'; +import { get as getStore } from 'svelte/store'; export function scroll(section) { - section.scrollIntoView({ behavior: 'smooth' }); + if (getStore(page).url.pathname !== '/') goto('/'); + console.log("section", section); + setTimeout(() => section.scrollIntoView({ behavior: 'smooth' }), 500); } const base = browser ? '' : PUBLIC_COINOS_URL; -- cgit v1.2.3