Make sure state has clients before trying to render them, may be cause of #806

This commit is contained in:
James Barnsley
2022-03-04 21:09:34 +13:00
parent 2d88e39671
commit 070b936f7d

View File

@ -100,7 +100,7 @@ const Group = ({
}) => {
const allClients = useSelector((state) => state.snapcast.clients || {});
const allStreams = indexToArray(useSelector((state) => state.snapcast.streams || {}));
const clients = clients_ids.length > 0
const clients = clients_ids.length > 0 && Object.keys(allClients).length > 0
? clients_ids.map((c) => allClients[c]).filter((c) => c.connected)
: [];
const dispatch = useDispatch();