Fix logos not being set.

This commit is contained in:
SergeantPanda 2025-09-16 16:25:50 -05:00
parent 64a019597d
commit 388d9e7171

View file

@ -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 = [];