机器人任务界面加入 websocket连接 卸载页面 的时候断开连接
This commit is contained in:
@@ -376,6 +376,11 @@ export default function DeviceStatusPage({
|
||||
if (!device || !controllerRef.current || !device?.serialNumber || isUAV) return;
|
||||
|
||||
controllerRef.current.connectDevice(device);
|
||||
return () => {
|
||||
controllerRef.current.destroy();
|
||||
controllerRef.current = null;
|
||||
|
||||
}
|
||||
}, [device?.serialNumber]);
|
||||
|
||||
// 定时获取无人机状态
|
||||
|
||||
Reference in New Issue
Block a user