路由懒加载 还要取消暂停路径规划接口 接入
This commit is contained in:
@@ -367,7 +367,9 @@ export default function DeviceStatusPage({
|
||||
controllerRef.current = controller;
|
||||
|
||||
return () => {
|
||||
controller.destroy();
|
||||
controller?.destroy();
|
||||
controllerRef.current?.destroy();
|
||||
|
||||
controllerRef.current = null;
|
||||
};
|
||||
}, [userInfo, messageApi]);
|
||||
@@ -376,11 +378,7 @@ 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]);
|
||||
|
||||
// 定时获取无人机状态
|
||||
|
||||
@@ -62,7 +62,7 @@ export default function RobotTaskPage() {
|
||||
const controller = new DeviceController(userInfo, messageApi);
|
||||
controllerRef.current = controller;
|
||||
return () => {
|
||||
controllerRef.current.destroy();
|
||||
controllerRef.current?.destroy();
|
||||
controllerRef.current = null;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user