From 5f3f614830b9299cfdb30f539bb24063962c8e28 Mon Sep 17 00:00:00 2001 From: Arhey Date: Fri, 17 Feb 2023 15:31:52 +0300 Subject: [PATCH] Update ChannelItem.svelte --- src/components/ChannelItem.svelte | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/ChannelItem.svelte b/src/components/ChannelItem.svelte index 88b826d9b..207df939e 100644 --- a/src/components/ChannelItem.svelte +++ b/src/components/ChannelItem.svelte @@ -10,13 +10,14 @@ const guides = channel._guides const streams = channel._streams - const currLocation = window.location.href + let currLocation const { open } = getContext('simple-modal') const onOpened = () => { + currLocation = window.location.href window.history.pushState({}, `${channel.name} • iptv-org`, `/channel?id=${channel.id}`) } const onClosed = () => { - window.history.pushState({}, `iptv-org`, currLocation) + window.history.pushState({}, `iptv-org`, currLocation || '/') } const showGuides = () => open( @@ -42,16 +43,6 @@ function pluralize(number, 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() - }