mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
vieo
This commit is contained in:
@@ -7,9 +7,18 @@ export function useVideoRequests(roverIds = []) {
|
||||
|
||||
useEffect(() => {
|
||||
const ids = Array.from(new Set(roverIds.filter(Boolean)));
|
||||
if (!ids.length) return;
|
||||
if (!ids.length) {
|
||||
setSources({});
|
||||
return;
|
||||
}
|
||||
let cancelled = false;
|
||||
|
||||
setSources((prev) => {
|
||||
const next = {};
|
||||
ids.forEach((id) => {
|
||||
if (prev[id]) next[id] = prev[id];
|
||||
});
|
||||
return next;
|
||||
});
|
||||
ids.forEach((roverId) => {
|
||||
socket.emit('video:request', { roverId }, (resp = {}) => {
|
||||
if (cancelled) return;
|
||||
|
||||
Reference in New Issue
Block a user