mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 10:45:27 +00:00
Add null check for channel name in notifications
This commit is contained in:
parent
e67f314656
commit
d3eb00fdf4
1 changed files with 17 additions and 5 deletions
|
|
@ -355,11 +355,23 @@ const useChannelsStore = create((set, get) => ({
|
|||
if (currentStats.channels) {
|
||||
for (const uuid in oldChannels) {
|
||||
if (newChannels[uuid] === undefined) {
|
||||
notifications.show({
|
||||
title: 'Channel streaming stopped',
|
||||
message: channels[channelsByUUID[uuid]].name,
|
||||
color: 'blue.5',
|
||||
});
|
||||
// Add null check for channel name
|
||||
const channelId = channelsByUUID[uuid];
|
||||
const channel = channelId && channels[channelId];
|
||||
|
||||
if (channel) {
|
||||
notifications.show({
|
||||
title: 'Channel streaming stopped',
|
||||
message: channel.name,
|
||||
color: 'blue.5',
|
||||
});
|
||||
} else {
|
||||
notifications.show({
|
||||
title: 'Channel streaming stopped',
|
||||
message: `Channel (${uuid})`,
|
||||
color: 'blue.5',
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const clientId in oldClients) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue