mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-11 17:40:05 -04:00
Fixes prerender error
This commit is contained in:
parent
48bb117276
commit
f405657e2f
2 changed files with 15 additions and 9 deletions
|
@ -1,9 +0,0 @@
|
|||
import { redirect } from '@sveltejs/kit'
|
||||
|
||||
export function load({ url }) {
|
||||
const id = url.searchParams.get('id')
|
||||
const [name, country] = id.split('.')
|
||||
const redirectUrl = `/channels/${country}/${name}`
|
||||
|
||||
throw redirect(302, redirectUrl)
|
||||
}
|
15
src/pages/channel/+page.svelte
Normal file
15
src/pages/channel/+page.svelte
Normal file
|
@ -0,0 +1,15 @@
|
|||
<script>
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
import { page } from '$app/stores'
|
||||
import { onMount } from 'svelte'
|
||||
|
||||
onMount(() => {
|
||||
const id = $page.url.searchParams.get('id')
|
||||
const [name, country] = id.split('.')
|
||||
const redirectUrl = `/channels/${country}/${name}`
|
||||
|
||||
window.location.replace(redirectUrl)
|
||||
})
|
||||
</script>
|
||||
|
||||
Redirecting...
|
Loading…
Add table
Add a link
Reference in a new issue