Update the frontend on logo change.

This commit is contained in:
SergeantPanda 2025-09-16 17:55:55 -05:00
parent 3cb5a061c9
commit 7e13e51198

View file

@ -418,9 +418,21 @@ export const WebsocketProvider = ({ children }) => {
loading: false,
autoClose: 6000,
});
// Refresh channels data
// Refresh channels data and logos
try {
await API.requeryChannels();
await useChannelsStore.getState().fetchChannels();
// Get updated channel data and extract logo IDs to load
const channels = useChannelsStore.getState().channels;
const logoIds = Object.values(channels)
.filter((channel) => channel.logo_id)
.map((channel) => channel.logo_id);
// Fetch the specific logos that were just assigned
if (logoIds.length > 0) {
await useLogosStore.getState().fetchLogosByIds(logoIds);
}
} catch (e) {
console.warn(
'Failed to refresh channels after logo setting:',