From 3a0b23836af9a6a13faf5ff83a98d304b2a245af Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Thu, 7 Dec 2023 00:58:51 +0300 Subject: [PATCH] Update CountryItem.svelte --- src/components/CountryItem.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/CountryItem.svelte b/src/components/CountryItem.svelte index bbadc19e2..8e37bb43a 100644 --- a/src/components/CountryItem.svelte +++ b/src/components/CountryItem.svelte @@ -6,12 +6,12 @@ import { fade } from 'svelte/transition' export let country - export let channels = [] + export let channels export let hasQuery - $: hasStreams = channels.filter(c => c.streams > 0) - - $: expanded = country.expanded || (channels && channels.length > 0 && hasQuery) + $: countryChannels = Array.isArray(channels) ? channels : [] + $: hasStreams = countryChannels.filter(c => c.streams > 0) + $: expanded = country.expanded || (countryChannels && countryChannels.length > 0 && hasQuery) $: intersect = _.intersectionBy($selected, hasStreams, 'id') $: isIndeterminate = intersect.length !== 0 && intersect.length < hasStreams.length $: isDisabled = hasStreams.length === 0