feat: improve channel deletion logic

This commit is contained in:
antebrl
2025-11-13 18:28:52 +01:00
parent 62a3b506b5
commit 4a55c4575e
3 changed files with 16 additions and 8 deletions

View File

@@ -155,17 +155,17 @@ function ChannelModal({ onClose, channel }: ChannelModalProps) {
const handleDelete = () => {
if (channel) {
addToast({
type: "error",
title: `Deleting ${type}`,
duration: 3000,
});
if (type === 'channel') {
socketService.deleteChannel(channel.id);
} else if (type === 'playlist') {
socketService.deletePlaylist(channel.playlist);
}
}
addToast({
type: 'error',
title: `${type} deleted`,
duration: 3000,
});
onClose();
};