From 0a222f27af4a56dfbf012cda3f7ac755ffa8b7c1 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 13 May 2025 16:52:21 -0500 Subject: [PATCH] Move fetchChannelProfiles to initdata --- frontend/src/components/tables/ChannelsTable.jsx | 6 ------ frontend/src/store/auth.jsx | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/frontend/src/components/tables/ChannelsTable.jsx b/frontend/src/components/tables/ChannelsTable.jsx index 4a0b8d4a..2716e994 100644 --- a/frontend/src/components/tables/ChannelsTable.jsx +++ b/frontend/src/components/tables/ChannelsTable.jsx @@ -238,7 +238,6 @@ const ChannelsTable = ({ }) => { const selectedProfileChannels = useChannelsStore( (s) => s.profiles[selectedProfileId]?.channels ); - const fetchChannelProfiles = useChannelsStore((state) => state.fetchChannelProfiles); // store/settings const env_mode = useSettingsStore((s) => s.environment.env_mode); @@ -567,11 +566,6 @@ const ChannelsTable = ({ }) => { setPaginationString(`${startItem} to ${endItem} of ${totalCount}`); }, [data]); - useEffect(() => { - // Fetch channel profiles when the component mounts - fetchChannelProfiles(); - }, []); - const columns = useMemo( () => [ { diff --git a/frontend/src/store/auth.jsx b/frontend/src/store/auth.jsx index a55b77d4..d98183bf 100644 --- a/frontend/src/store/auth.jsx +++ b/frontend/src/store/auth.jsx @@ -39,6 +39,7 @@ const useAuthStore = create((set, get) => ({ await Promise.all([ useChannelsStore.getState().fetchChannels(), useChannelsStore.getState().fetchChannelGroups(), + useChannelsStore.getState().fetchChannelProfiles(), usePlaylistsStore.getState().fetchPlaylists(), useEPGsStore.getState().fetchEPGs(), useEPGsStore.getState().fetchEPGData(),