fixed object spreadin in TrackProvider
This commit is contained in:
parent
a509c3b563
commit
262d93c86e
|
|
@ -219,21 +219,19 @@ export const TracksProvider = ({ children }) => {
|
||||||
const callParticipants = callObject.participants();
|
const callParticipants = callObject.participants();
|
||||||
const updates = ids.reduce((o, id) => {
|
const updates = ids.reduce((o, id) => {
|
||||||
const { subscribed } = callParticipants?.[id]?.tracks?.audio;
|
const { subscribed } = callParticipants?.[id]?.tracks?.audio;
|
||||||
const result = {};
|
const result = { ...o[id] };
|
||||||
if (!subscribed) {
|
if (!subscribed) {
|
||||||
result[id] = {
|
result.setSubscribedTracks = {
|
||||||
setSubscribedTracks: {
|
audio: true,
|
||||||
audio: true,
|
screenAudio: true,
|
||||||
screenAudio: true,
|
screenVideo: true,
|
||||||
screenVideo: true,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtcpeers?.getCurrentType?.() === 'peer-to-peer') {
|
if (rtcpeers?.getCurrentType?.() === 'peer-to-peer') {
|
||||||
result[id].setSubscribedTracks.video = true;
|
result.setSubscribedTracks.video = true;
|
||||||
}
|
}
|
||||||
return { ...o, ...result };
|
return { [id]: result };
|
||||||
}, {});
|
}, {});
|
||||||
callObject.updateParticipants(updates);
|
callObject.updateParticipants(updates);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue