mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-25 02:57:57 +00:00
Fixes console error when playing a stream preview due to channelID being null.
This commit is contained in:
parent
6f1bae8195
commit
246ab0a22d
1 changed files with 11 additions and 5 deletions
|
|
@ -323,11 +323,17 @@ const useChannelsStore = create((set, get) => ({
|
|||
acc[ch.channel_id] = ch;
|
||||
if (currentStats.channels) {
|
||||
if (oldChannels[ch.channel_id] === undefined) {
|
||||
notifications.show({
|
||||
title: 'New channel streaming',
|
||||
message: channels[channelsByUUID[ch.channel_id]].name,
|
||||
color: 'blue.5',
|
||||
});
|
||||
// Add null checks to prevent accessing properties on undefined
|
||||
const channelId = channelsByUUID[ch.channel_id];
|
||||
const channel = channelId ? channels[channelId] : null;
|
||||
|
||||
if (channel) {
|
||||
notifications.show({
|
||||
title: 'New channel streaming',
|
||||
message: channel.name,
|
||||
color: 'blue.5',
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
ch.clients.map((client) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue