aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-08 10:13:03 -0800
committerAdam Soltys <[email protected]>2023-02-08 10:13:03 -0800
commit3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2 (patch)
treee22c32c9948e4bacfc14bdc8f95a16c557a916e5 /src/lib/utils.js
parent38a1046a92a8f6e3168c5054dc7de2cb3fd8e726 (diff)
downloadcoinos-ui-3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2.tar.gz
coinos-ui-3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2.zip
rm uuid route
Diffstat (limited to 'src/lib/utils.js')
-rw-r--r--src/lib/utils.js6
1 files changed, 5 insertions, 1 deletions
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;