Update ChannelItem.svelte

This commit is contained in:
Arhey 2023-02-17 15:31:52 +03:00
parent 5151d89db5
commit 5f3f614830

View file

@ -10,13 +10,14 @@
const guides = channel._guides const guides = channel._guides
const streams = channel._streams const streams = channel._streams
const currLocation = window.location.href let currLocation
const { open } = getContext('simple-modal') const { open } = getContext('simple-modal')
const onOpened = () => { const onOpened = () => {
currLocation = window.location.href
window.history.pushState({}, `${channel.name} • iptv-org`, `/channel?id=${channel.id}`) window.history.pushState({}, `${channel.name} • iptv-org`, `/channel?id=${channel.id}`)
} }
const onClosed = () => { const onClosed = () => {
window.history.pushState({}, `iptv-org`, currLocation) window.history.pushState({}, `iptv-org`, currLocation || '/')
} }
const showGuides = () => const showGuides = () =>
open( open(
@ -42,16 +43,6 @@
function pluralize(number, word) { function pluralize(number, word) {
return number > 1 ? word + 's' : word return number > 1 ? word + 's' : word
} }
function searchBy(q) {
if ($query !== q) {
query.set(q)
hasQuery.set(true)
search(q)
setSearchParam('q', q)
}
close()
}
</script> </script>
<tr <tr