From ab36b28b5166afdf377a751ebc4db89c85f5dea6 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 11 Sep 2025 15:03:26 -0500 Subject: [PATCH] Fix logos not loading in channel edit form. --- frontend/src/components/forms/Channel.jsx | 131 ++++++++++++++++------ frontend/src/hooks/useSmartLogos.jsx | 10 +- 2 files changed, 101 insertions(+), 40 deletions(-) diff --git a/frontend/src/components/forms/Channel.jsx b/frontend/src/components/forms/Channel.jsx index fc4a26f5..574c5d3a 100644 --- a/frontend/src/components/forms/Channel.jsx +++ b/frontend/src/components/forms/Channel.jsx @@ -55,6 +55,11 @@ const ChannelForm = ({ channel = null, isOpen, onClose }) => { ensureLogosLoaded, isLoading: logosLoading, } = useChannelLogoSelection(); + + // Ensure logos are loaded when component mounts + useEffect(() => { + ensureLogosLoaded(); + }, [ensureLogosLoaded]); const streams = useStreamsStore((state) => state.streams); const streamProfiles = useStreamProfilesStore((s) => s.profiles); const playlists = usePlaylistsStore((s) => s.playlists); @@ -242,17 +247,10 @@ const ChannelForm = ({ channel = null, isOpen, onClose }) => { // Memoize logo options to prevent infinite re-renders during background loading const logoOptions = useMemo(() => { - return [{ id: '0', name: 'Default' }].concat(Object.values(logos)); + const options = [{ id: '0', name: 'Default' }].concat(Object.values(logos)); + return options; }, [logos]); // Only depend on logos object - const renderLogoOption = ({ option, checked }) => { - return ( -
- -
- ); - }; - // Update the handler for when channel group modal is closed const handleChannelGroupModalClose = (newGroup) => { setChannelGroupModalOpen(false); @@ -454,7 +452,7 @@ const ChannelForm = ({ channel = null, isOpen, onClose }) => {