Don't scroll back to top when changing Photos and Shop products pages

This commit is contained in:
2021-11-21 22:43:24 +01:00
parent 8e56d58b30
commit 4c43e1458e
2 changed files with 18 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
import { navigating, page } from '$app/stores'
import { onMount, setContext } from 'svelte'
import { pageLoading } from '$utils/stores'
import { scrollToTop } from '$utils/functions'
import { DURATION } from '$utils/contants'
import '$utils/polyfills'
// Components
@@ -34,12 +35,10 @@
// Scroll back to top between page transitions
setTimeout(() => {
// scrollToTop()
// Disable scroll when changing filters on /photos?
if (!$page.query.get('country')) {
window.scrollTo(0,0)
// Disable scroll when changing filters on /photos and shop?
if (!$page.query.get('country') && !$page.path.includes('/shop/poster')) {
scrollToTop()
}
}, DURATION.PAGE_OUT * 1.5)
}
})