From 388d9e7171da1e56ef77f2113807eccc80b51943 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 16 Sep 2025 16:25:50 -0500 Subject: [PATCH] Fix logos not being set. --- frontend/src/components/forms/ChannelBatch.jsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/forms/ChannelBatch.jsx b/frontend/src/components/forms/ChannelBatch.jsx index 226565a9..1025194c 100644 --- a/frontend/src/components/forms/ChannelBatch.jsx +++ b/frontend/src/components/forms/ChannelBatch.jsx @@ -4,6 +4,7 @@ import API from '../../api'; import useStreamProfilesStore from '../../store/streamProfiles'; import useEPGsStore from '../../store/epgs'; import ChannelGroupForm from './ChannelGroup'; +import { useLogoSelection } from '../../hooks/useSmartLogos'; import { Box, Button, @@ -44,6 +45,12 @@ const ChannelBatchForm = ({ channelIds, isOpen, onClose }) => { const tvgs = useEPGsStore((s) => s.tvgs); const tvgsById = useEPGsStore((s) => s.tvgsById); + const { + logos, + ensureLogosLoaded, + isLoading: logosLoading, + } = useLogoSelection(); + const [channelGroupModelOpen, setChannelGroupModalOpen] = useState(false); const [selectedChannelGroup, setSelectedChannelGroup] = useState('-1'); const [isSubmitting, setIsSubmitting] = useState(false); @@ -207,12 +214,8 @@ const ChannelBatchForm = ({ channelIds, isOpen, onClose }) => { } try { - // First, get all available logos - const logosResponse = await API.getLogos(); - const logos = logosResponse.reduce((acc, logo) => { - acc[logo.id] = logo; - return acc; - }, {}); + // Ensure logos are loaded first + await ensureLogosLoaded(); const channelsMap = useChannelsStore.getState().channels; const updates = [];