Update +page.svelte

This commit is contained in:
freearhey 2025-01-29 22:20:18 +03:00
parent a8de7b8ad9
commit 3a515c8ac2

View file

@ -4,7 +4,10 @@
onMount(() => { onMount(() => {
const id = $page.url.searchParams.get('id') const id = $page.url.searchParams.get('id')
if (!id) return window.location.replace('/')
const [name, country] = id.split('.') const [name, country] = id.split('.')
if (!name || !country) return window.location.replace('/')
const redirectUrl = `/channels/${country}/${name}` const redirectUrl = `/channels/${country}/${name}`
window.location.replace(redirectUrl) window.location.replace(redirectUrl)